Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Sending mails via gmail

by noxxi (Pilgrim)
on Sep 03, 2016 at 07:53 UTC ( [id://1171101]=note: print w/replies, xml ) Need Help??


in reply to Sending mails via gmail

Just to compare the modules you've proposed:
  • Net::SMTP::TLS - based on Net::SMTP, last update 2006. Will not work without bug fixes.
  • These bug fixes are included in the successor Net::SMTP::TLS_ButMaintained, which isn't maintained anymore too (last release 2013). Apart from that this module disables certificate validation and this way opens you to man in the middle attacks.
  • Email::Send::SMTP::TLS - just uses Net::SMTP::TLS_ButMaintained and thus has the same problems (no certificate validation)
  • Email::Send::Gmail - based on Net::SMTP::SSL which is just a hack into Net::SMTP (changes superclass to IO::Socket::SSL). Not maintained anymore, i.e. last update 2008.
  • Email::Send::SMTP::Gmail - based on Net::SMTPS which again is based on Net::SMTP. Email::Send::SMTP::Gmail disables certificate validation by default too.
My recommendation:
go with a recent version of Net::SMTP. This version has support for explicit and implicit SSL/TLS and also for IPv6. It also does proper certificate validation and validation is enabled by default. And it is a CORE module, although the version with SSL is only included starting with perl 5.22.0 (and still needs IO::Socket::SSL installed). With older versions you can either install the new libnet (which includes Net::SMTP), install Net::SSLGlue::SMTP which monkey patches Net::SMTP for SSL support or use Net::SMTPS which behaves similar (but not the same) to Net::SMTP with SSL support.
Since Net::SMTP cares only about the SMTP dialog you can still use Mime::Lite as you've used to be to construct the mail and then send it within the SMTP dialog with $smtp->data($mime_lite->as_string).

Replies are listed 'Best First'.
Re^2: Sending mails via gmail
by Anonymous Monk on Sep 03, 2016 at 08:20 UTC

    Thanks for the detailed & very considerate reply (not OP).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1171101]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2024-04-18 11:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found