in reply to Re^2: MIME::LITE and Smtp authentication
in thread MIME::LITE and Smtp authentication
#!/usr/bin/perl use warnings; use strict; use MIME::Lite; use Net::SMTP_auth; #login once my $smtp = Net::SMTP_auth -> new( 'zentara.zentara.net' ); $smtp -> auth( 'LOGIN', 'z', 'ztest' ); ###### put your loop here ######### foreach my $addr ( @addresses){ #compose your message as_string #you can have a very complex MIME::Lite mail here my $msg = MIME::Lite -> new ( From => 'z@zentara.zentara.net', TO => $addr, Subject => 'Testing Text Message', Data => 'How\'s it going.' ); $smtp->mail('z@zentara.zentara.net'); $smtp->to($addr); $smtp -> data(); $smtp -> datasend( $msg->as_string() ); $smtp -> dataend(); } ############################ ## quit when finished loop $smtp -> quit;
|
|---|