Your posting problem is that you failed to put <code> tags around your </code>.
use strict;
use Net::SMTP;
my $globalMailServer = "127.0.0.1";
{
sendmail ('JoeCool@somewhere.com', # put real e-mail address here
'JoeCoolio', # put your real name here
'shipping@somewhere.com', # put dest e-mail address here
'Shipping Department', # put dest name here
'You the man', # subject
'This probably wont work, but oh well.'); # message
}
sub sendmail
{
@_ == 6 or die "Improper number of arguments";
my ($fromemail, $fromname, $toemail, $toname, $subject, $message)
+= @_;
my $smtp = 0;
$smtp = Net::SMTP->new($globalMailServer) or die "Can't connect to
+ mail server named '$globalMailServer'\n";
$smtp->mail ($fromemail);
$smtp->to ($toemail);
$smtp->data ();
$smtp->datasend ("To: $toname\n");
$smtp->datasend ("From: $fromname\n");
$smtp->datasend ("Subject: $subject\n");
$smtp->datasend ("\n");
$smtp->datasend ($message);
$smtp->dataend ();
$smtp->quit;
}
|