in reply to Re: Email Modules
in thread Email Modules

It's basic, it's fast, it's portable, and you don't have to worry about installing a whole module to send a message.
 

I strongly disagree with this - This approach is by far not portable as it depends on a number of factors:

Furthermore, as for the ease of using this approach without installing modules, the Net::SMTP module is included as part of the core Perl installation and as such should be available on all installations. Additionally the use of this module is very straight-forward, for example,

my $smtp = Net::SMTP->new('mail.mydomain.com'); $smtp->mail($fromaddr); $smtp->to($to); $smtp->data(); $smtp->data("Subject: $subject\n\n"); $smtp->data($message); $smtp->dataend(); $smtp->quit;

Furthermore, the use of the local network SMTP server will make your network administrator happier as it is at this point that network mail policies and statistics reporting is often based.

 

Replies are listed 'Best First'.
Re: Re: Re: Email Modules
by kappa (Chaplain) on Jun 02, 2002 at 12:52 UTC
    Using Net::SMTP is a little more portable than piping to /usr/sbin/sendmail but not half as portable as using a general mail sending module such as Mail::Sendmail or MIME::Lite (all of them have an ability to send mail via SMTP).

    Besides, I cannot find Net::SMTP among perl core modules neither in 5.6.1 not earlier versions. There's a recent node on the topic.

Re: Re: Re: Email Modules
by oakbox (Chaplain) on Jun 03, 2002 at 06:51 UTC
    This approach is by far not portable as it depends on a number of factors:

    Pipe to sendmail IF: You are on a *nix variant and know where the sendmail binary is. But I should mention that most distributions recognize sendmail as the defacto email server. Even Qmail recommends symlinking to the /usr/sbin/sendmail location.


    -oakbox