Hi,
I'm trying to write a script to send email, and I'm using the Mail::Sender package for it. I'm using my company's exchange server to send it, which uses NTLM authentication. I'm not able to login. What am i missing?
use Mail::Sender;
use Authen::NTLM;
open my $DEBUG, ">file.txt" or die "Can't open the debug file: $!\n";
my $sender = new Mail::Sender{
smtp => 'mail.company.com', #disguised
on_errors=>'die',
from => 'sender@domain.com',
to =>'recipient@domain.com',
subject => 'this is a test',
auth =>'NTLM',
authid => 'user',
authpwd => 'password',
authdomain=>'domain',
debug => $DEBUG,
debug_level=>'4'
}
or die "$Mail::Sender::Error\n";
$sender->Open();
$sender->SendLineEnc("Hi,\n wasaaaaaaaa!\n");
$sender->Close();
The error I get: Authentication unsuccessful
Here's the complete log file -
>> 220 025-SN1MMR1-003 Authenticated Client Access Receive Connector
<< EHLO C9118DEF1EFEBC4.xxx.xxxxxxx.com
>> 250-025-SN1MMR1-003.025d.xxx.xxx.net Hello [123.123.123.123] <disgu
+ised>
>> 250-SIZE 73400320
>> 250-PIPELINING
>> 250-DSN
>> 250-ENHANCEDSTATUSCODES
>> 250-STARTTLS
>> 250-AUTH NTLM
>> 250-8BITMIME
>> 250-BINARYMIME
>> 250 CHUNKING
<< AUTH NTLM
>> 334 NTLM supported
<< TlRMTVNTUAABAAAAB7IAAAcABwAgAAAABAAEACcAAABCWEMwNTU3QU1FUg==
>> 334 TlRMTVNTUAACAAAACAAIADgAAAAFgoECwB/WyydSiQ8AAAAAAAAAANAA0ABAAAA
+ABgGxHQAAAA8wADIANQBEAAIACAAwADIANQBEAAEAHgAwADIANQAtAFMATgAxAE0ATQBS
+ADEALQAwADAAMwAEACIAMAAyADUAZAAuAG0AZwBkAC4AbQBzAGYAdAAuAG4AZQB0AAMAQ
+gAwADIANQAtAFMATgAxA0ATQBSADEALQAwADAAMwAuADAAMgA1AGQALgBtAGcAZAAuAG0
+AcwBmAHQALgBuAGUAdAAFACIAMAAyADUAZAAuAG0AZwBkAC4AbQBzAGYAdAAuAG4AZQB0
+AAcACAAxkEKdoKzNAQAAAAA=
<< TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAgACABwAAAADgAOAHgAAAAOAA4AhgAA
+AAAAAABUAAAABYKBAmXjRHO4f7Up8gDJRi6go2ftbklSQhvUifVDfd1R0yIz1YrYKXls9
+nDGT9l6iw1J/zAAMgA1AEQAQgBYAEMAMAA1ADUANwBCAFgAQwAwADUANQA3AA==
>> 535 5.7.3 Authentication unsuccessful
<< quit
What am I doing wrong? The login and password are correct, and I can succesfully use this script to send mail through an outside smtp server ( for e.g. comcast, by using LOGIN protocol , though).
Any help will be appreciated.
Thanks!
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.