How can I send mail through Gmail with Perl?

倖福魔咒の 提交于 2021-02-06 23:56:08

问题


How can I send email using Perl through my Gmail account? The one CPAN library (Mail::Webmail::Gmail) that I tried didn't work and I don't see much activity with it.

At the moment I really only need to send a message. However, the advanced functionality of getting my contacts, acting when a new email is received that has a certain label, etc. certainly seems appealing for another day.


回答1:


Did you try Email::Send::Gmail?




回答2:


You could always send with SMTP. The server is smtp.gmail.com, it requires TLS and uses authentication. You may also have to enable POP/IMAP in your account.




回答3:


I had the same problem with Mail::Webmail::Gmail, I ended up using Net::IMAP::Simple::SSL to get my mail from gmail. I'd guess if I had to try to send mail with it I would first try Net::SMTP::Server .




回答4:


I have extended WWW::Contact::GoogleContactsAPI to get all the contact fields. See:

Is there a Perl module to interface to Google Contacts API?



来源:https://stackoverflow.com/questions/279757/how-can-i-send-mail-through-gmail-with-perl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!