Thanks for pointing me to Mail::Sender!  But before I can get to the smtp authentication part, I was unable to send a simple message to myself.  The error message returned was "connect() failed: Unknown error".  I found the following hints from the doc, but I am sending mail from Windows. 
 
"If you are able to connect to the mail server and scripts using Mail::Sendmail work, 
but Mail::Sender fails with "connect() failed", please review the settings in /etc/services. 
The port for SMTP should be 25."
 
Any clue/help is much appreciated!
 
Thanks,
d
 
sub SendMailNotice() {
 my $subject = "This is a test.";
 my $msg = "Trying to make it work";
 
 my $sender = new Mail::Sender {
  smtp => 'xx.xxx.1.xxx',
  from => '[EMAIL PROTECTED]',
   'undef',
 }
  or die "Can't create the Mail::Sender object: $Mail::Sender::Error\n";
 
 if (ref ($sender->MailMsg({to => '[EMAIL PROTECTED]', subject => 'this is a test',
                         msg => "Trying to make it work."}))) {
   print "Mail sent OK."
 } else {
  die "$Mail::Sender::Error\n";
 }
 
}

Fabricio Soares Martins - Site CBN - SGR <[EMAIL PROTECTED]> wrote:
Hi,
 
Try this module:
mail::sender
 
in perldoc mail::sender ->
 
  if ($sender->MailMsg({
    smtp => 'mail.yourISP.com',
    from => '[EMAIL PROTECTED]',
    to =>'[EMAIL PROTECTED]',
    subject => 'this is a test',
    msg => "Hi Johnie.\nHow are you?"
    auth => 'NTLM',
    authid => 'jenda',
    authpwd => 'benda',
  }) < 0) {
   die "$Mail::Sender::Error\n";
 
 
-----Mensagem original-----
De: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]Em nome de Danna Li
Enviada em: sexta-feira, 3 de novembro de 2006 17:18
Para: perl-win32-admin@listserv.ActiveState.com
Assunto: smtp authentication

Hello,
 
I need to send notifications to a large email list but the company has setup smtp authentication for that particular email list.
 
How do I authenticate (smtp) on windows with perl.
 
Any help would be greatly appreciated!!
 
Thanks,
d

Low, Low, Low Rates! Check out Yahoo! Messenger's cheap PC-to-Phone call rates.


Cheap Talk? Check out Yahoo! Messenger's low PC-to-Phone call rates.
_______________________________________________
Perl-Win32-Admin mailing list
Perl-Win32-Admin@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to