Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Thanks.
use strict; use warnings; use Net::SMTP; my $smtp = Net::SMTP->new('MAILSERVER') or die $!; my ($from, $to) = ('blah@domain.com', 'user@otherdomain.com'); my ($subject, $message) = ('Test subject', 'Test message'); $smtp->mail( $from ); $smtp->to( $to ); $smtp->data(); $smtp->datasend("To: $to\n"); $smtp->datasend("From: $from\n"); $smtp->datasend("Subject: $subject\n"); $smtp->datasend("\n"); # done with header $smtp->datasend($message); $smtp->dataend(); $smtp->quit(); # all done. message sent.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending e-mail with attachments.
by periapt (Hermit) on Jun 08, 2004 at 18:55 UTC | |
|
Re: Sending e-mail with attachments.
by drewbie (Chaplain) on Jun 08, 2004 at 19:26 UTC | |
|
Re: Sending e-mail with attachments.
by eclark (Scribe) on Jun 08, 2004 at 18:30 UTC | |
|
Re: Sending e-mail with attachments.
by vek (Prior) on Jun 08, 2004 at 18:58 UTC | |
|
Re: Sending e-mail with attachments.
by runrig (Abbot) on Jun 08, 2004 at 19:17 UTC |