jking_98 has asked for the wisdom of the Perl Monks concerning the following question:
my $email = MIME::Lite->new( From => $from_address, To => \@to_addresses, Cc => \@cc_addresses, Bcc => \@bcc_addresses, Subject => 'test', Type => 'multipart/alternative', ); $email->attach(Type => 'text/html',Data => "HTML Text"); $email->attach(Type => 'text/plain',Data => "Plan Text"); # get the message my $message_body = $email->as_string(); # Create a new SMTP object my $smtp = Net::SMTP_auth->new($host, Timeout => 60, Debug => 1) or die "Couldn't connect to server"; my $res = $smtp->auth('LOGIN',$user_name,$password); $smtp->mail($from_address); $smtp->to(@to_addresses); $smtp->cc(@cc_addresses); $smtp->bcc(@bcc_addresses); $smtp->data(); $smtp->datasend($message_body); $smtp->dataend(); # Close the connection $smtp->quit();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using Net::SMTP_auth to send authenticated emails
by tcf22 (Priest) on Aug 20, 2003 at 20:09 UTC | |
by jking_98 (Initiate) on Aug 20, 2003 at 21:17 UTC |