I don't want to use sendmail to send an email but would prefer to use SMTP. How can I use Perl to send an email to my GMAIL account?
相关问题
- Django & Amazon SES SMTP. Cannot send email
- $ENV{$variable} in perl
- Is it possible to pass command-line arguments to @
- Redirecting STDOUT and STDERR to a file, except fo
- Change first key of multi-dimensional Hash in perl
相关文章
- c#发送邮件,附件损坏
- How do I make a forward e-mail link?
- Running a perl script on windows without extension
- Comparing speed of non-matching regexp
- Can NOT List directory including space using Perl
- Extracting columns from text file using Perl one-l
- com.sun.mail.smtp.SMTPSenderFailedException: 550 5
- Lazy (ungreedy) matching multiple groups using reg
If you aren't familiar with CPAN (Comprehensive Perl Archive Network) I recommend you to bookmark that site. It contains third party (mostly well tested) libraries.
An example showing how to send emails using perl: http://www.perlfect.com/articles/sendmail.shtml
There are muliple SMTP modules on CPAN, for example Net::ESMTP. Also, sendmail very probably does use SMTP to communicate with mail servers, so what's your real reason for not wanting to use it?
As per the comment, it's not clear if you want to send email via Google's SMTP, or just send email in general (perhaps to your gmail account). You should check out Email::Send and possibly Email::Send::Gmail.
Alternatively, if what you're really asking is how do I move email from somewhere that isn't Gmail to Gmail, I've had very good luck with IMAP using Mail::Box and the Mail::Box::IMAP4::SSL backend. You can see an example of use here.