DelphiFAQ Home Search:
General :: Programming :: perl
General questions about perl.


This list is sorted by recent document popularity (not total page views).
New documents will first appear at the bottom.
Recommended links on this topic:
Featured Article

Send an email from my perl script


How can my perl script send an email? I'm working under Linux.


The solution below assumes that sendmail is installed as /usr/lib/sendmail. You might have to adjust the first line appropriately.

 $mailprog = '/usr/lib/sendmail';
 open(MAIL,"|$mailprog -t");
 print MAIL "To: bill_gates\\n";
 print MAIL "From: your_mother <no_reply\>\n";
 print MAIL "Subject: $subject\n\n";
 print MAIL 'This message is a test.';
 close (MAIL);

Generated 4:01:32 on Jul 13, 2020