By using Net::SMTP instead of MIME::Lite, Mail::Sendmail or Mail::Sender we usually lose:
flexibility when specifying email addresses
Net::SMTP recipients() method (or to() alias) accepts only plain emails. You just cannot take a To: line from a mail template and pass it to Net::SMTP, because Net::SMTP will choke on $smtp->to("sales@domain.com, check@domain.com") or $smtp->to("Sales <sales@domain.com>"). You people usually don't want to parse RFC822 email headers, do you?
ability to send complex emails (MIME)
Net::SMTP only allows you to send raw data. If you have enough time to do MIME by hands, I admire and envy you. But if you use MIME::Entity or MIME::Lite, why even bother with Net::SMTP? These modules send their results to the Internet just perfectly (using Net::SMTP internally if you specify SMTP delivery).
ability to send mail in SMTP-challenged environments
These includes not only dialup systems but also uucp-connected (there're some). In spite of the fact that most of the time such systems have a local smtp-server running which will handle queueing and the like, there's a case which hit me just recently.
My hosting provider runs cgi-scripts inside a sandboxed environment without ip-connectivity to Internet. (And that's a good security practice for all free hostings out there). And the provider allows sending mails only via sendmail(1) just to be able to impose restrictions on sending mail.
Even if these facts may seem of little importance to the majority of Perl programmers out there, Net::SMTP gives practically no advantages over other mail-sending modules, which are usually capable of using either SMTP connection or sendmail(1). The only advantage I see is sending several mails via a single connection for speed. In this case your (very specialized) program is more of an SMTP client than a mail-sending entity. And that's the very case Net::SMTP is perfect to serve, but such cases are very rare (are you a bulk sender?).
And it's sad for me to see such posts as Net::SMTP v local MTA or SMTP Modules that are both Win32 and Unix compliant when people intentionally choose Net::SMTP over other alternatives due to Windows lacking sendmail(1).
Update: I just found the relevant item in perlfaq9. It confirms my strong negative feelings about too wide-spread use of Net::SMTP.
|
---|