As Jenda mentioned your exchange server might not support SMTP. You may
also run into mail relay problems with exchange if you don't
authenticate with a DOMAIN. Also it's very likely that exchange is not
configured to relay outside the company. For simple mail messages I use
Mail::Sendmail
# Exchange relays this fine INSIDE the company which is all I need
use Mail::Sendmail;
$mail{Smtp} = 'mailserver'; # override sendmail.pm
my $domain = 'yourdomain.com'
my $user = 'your name'
$mail{From} = "$user\@$domain" ;
$mail{To} = "$user\@$domain" ;
$mail{Subject} = "Test Mail" ;
$mail{Message} = "foo";
$mail{Message} .= "bar \n";
sendmail %mail ;
if ($Mail::Sendmail::error) {
print "content of
\$Mail::Sendmail::error:\n$Mail::Sendmail::error\n";
}
exit 0;
> -----Original Message-----
> From: Jenda Krynicky [mailto:[EMAIL PROTECTED]]
> Sent: Friday, February 15, 2002 10:57 AM
> To: '[EMAIL PROTECTED]'
> Subject: Re: Mail::Sender on WinNT - can't connect
>
>
> From: "murphy, daniel (BMC Eng)"
> <[EMAIL PROTECTED]>
>
> > I've been wanting to send mail from some of my scripts, so I thought
> > I'd see how to get it to work.
> >
> > I chose to use Mail::Sender and am running Perl 5.005_03 from
> > ActiveState build 522 (I know, it's old) on WinNT. When I run this
> > simple test script:
> >
> > use Mail::Sender;
> >
> > ref ($sender = new Mail::Sender
> > {smtp => 'srmontana',
> > from => '[EMAIL PROTECTED]'})
> > or die "$Mail::Sender::Error\n";
> >
> > ------------------
> >
> > I get,
> >
> > connect() failed: Unknown error
>
> Does that server accept SMTP ?
>
> If you try
> telnet srmontana 25
> do you connect and get a reply something like:
> 220 srmontana.emc.com MS Exchange ESMTP server ready.
>
> If not you'll have to find another server to relay the mail for you.
>
> > Do things look right?
>
> Yes.
>
> > Is there some type of authentication, (userid, password,
> etc.) that's
> > taking place? There must be, right?
>
> If the server requires authentication then you cannot use
> Mail::Sender. Except if it requires "POP3 before SMTP" or
> whatever is it called ... in that case you'd have to connect and log
> into the server using Mail::POP3Client or Net::POP3 and then
> connect with Mail::Sender.
>
> Maybe you could try either Win32::MAPI or use Win32::OLE to
> control Outlook.
>
> Jenda
>
>
> =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==========
> There is a reason for living. There must be. I've seen it somewhere.
> It's just that in the mess on my table ... and in my brain.
> I can't find it.
> --- me
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]