in reply to Re^2: Net::SMTP Module query
in thread Net::SMTP Module query
Update:
Sorry, the first line was wrong for you. But i think you noted this.
#!/usr/bin/perl use Net::SMTP; use strict; use warnings; print "Content-type: text/html\n\n"; my $MailHost = "mailhost"; my $MailFrom = "someone\@somewhere"; my $MailTo = "someone\@somewhere"; my $subject = "Super!\n"; my $MailBody = "It works!\n"; my $smtp = Net::SMTP->new($MailHost) || die $!; $smtp->mail($MailFrom); $smtp->to($MailTo); $smtp->data(); $smtp->datasend("To: $MailTo\n"); $smtp->datasend("From: $MailFrom\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("\n"); $smtp->datasend("$MailBody\n\n"); $smtp->dataend(); $smtp->quit;
Please try this. Regards, Karl
«The Crux of the Biscuit is the Apostrophe»
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Net::SMTP Module query
by gilesy (Initiate) on Nov 12, 2012 at 13:04 UTC | |
by karlgoethebier (Abbot) on Nov 12, 2012 at 13:08 UTC | |
by gilesy (Initiate) on Nov 12, 2012 at 13:18 UTC |
In Section
Seekers of Perl Wisdom