Beefy Boxes and Bandwidth Generously Provided by pair Networks httptech
The stupid question is the question not asked
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
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!

In reply to Unable to do NTLM auth on mail sending script using Mail::Sender by barun2u

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • 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, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (15)
    As of 2014-04-24 11:04 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      April first is:







      Results (565 votes), past polls