[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cobalt-users] perl script-generated sendmail headers
- Subject: Re: [cobalt-users] perl script-generated sendmail headers
- From: Tim Dunn <tdunn@xxxxxxxxxxxxxxxxxxx>
- Date: Tue May 28 12:45:10 2002
- List-id: Mailing list for users to share thoughts on Sun Cobalt products. <cobalt-users.list.cobalt.com>
Simple question: why use sendmail then? Why not open a port to the
remote SMTP server?
from http://www.mannyjuan.com/tricks.htm
use Net::SMTP;
$smtp = Net::SMTP->new($mailserver); # connect to an SMTP server
$smtp->mail($myemail); # use the sender's address here
$smtp->to($email); # recipient's address
$smtp->data(); # Start the mail
# Send the header.
$smtp->datasend("To: $email\n");
$smtp->datasend("From: $myemail\n");
$smtp->datasend("Subject: Subject\n");
$smtp->datasend("\n");
# Send the body.
$smtp->datasend("this place is here - wish you were beautiful!\n");
...
$smtp->datasend("\n");
$smtp->dataend(); # Finish sending the mail
$smtp->quit; # Close the SMTP connection
tim
--
Mechanical Engineers build weapons. Civil Engineers build targets.