DigitalKitty has asked for the wisdom of the Perl Monks concerning the following question:
#!\usr\bin\perl -wT use strict; use Net::SMTP; use CGI qw ( :standard ); my ( $from, $to, $subject, $message, $address, $server, $myAddress ); $from = param( "from" ); $to = param( "to" ); $subject = param( "subject" ); $message = param( "message" ); $address = param( "address" ); $server = param( "server" ); $myAddress = param( "myAddress" ); my $smtp = new Net::SMTP( "$server", Hello => "$server" ) or die "Ughh! Unable to send email : $!\n"; $smtp->to( "$to ); $smtp->mail( "$myAddress" ); $smtp->data(); $smtp->datasend( "From: $from\n" ); $smtp->datasend( "To: $to\n" ); $smtp->datasend( "Subject: $subject\n\n\n" ); $smtp->datasend( "$message\n" ); $smtp->dataend(); $smtp->quit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sending email from a file.
by ibanix (Hermit) on Dec 05, 2002 at 08:38 UTC | |
|
Re: Sending email from a file.
by robartes (Priest) on Dec 05, 2002 at 08:55 UTC | |
|
(z) Re: Sending email from a file.
by zigdon (Deacon) on Dec 05, 2002 at 13:42 UTC |