/ Published in: Perl
Expand |
Embed | Plain Text
use Net::SMTP; $smtp = Net::SMTP->new('here.com'); # connect to an SMTP server $smtp->mail( 'user\@here.com' ); # use the sender's address here $smtp->to('user\@there.com'); # recipient's address $smtp->data(); # Start the mail # Send the header. $smtp->datasend("To: user\@there.com\n"); $smtp->datasend("From: user\@here.com\n"); $smtp->datasend("\n"); # Send the body. $smtp->datasend("Hello, World!\n"); $smtp->dataend(); # Finish sending the mail $smtp->quit; # Close the SMTP connection
You need to login to post a comment.
