I have written following code.

use MIME::Lite; # set up email $to = "myname\@domain.com"; $from = "myname\@domain.com"; $subject = "Email Sent via Perl"; $message = "This email was sent using Perl."; # send email email($to, $from, $subject, $message,); # email function sub email { # get incoming parameters local ($to, $from, $subject, $message) = @_; # create a new message $msg = MIME::Lite->new( From => $from, To => $to, Subject => $subject, Data => $message ); # send the email MIME::Lite->send('smtp', 'microsoft.exchange.server', AuthUser=>'myna +me', AuthPass=>'my_password', Debug=>1); $msg->send(); }
When I am executing the code. I am getting following error.

MIME::Lite::SMTP>>> MIME::Lite::SMTP MIME::Lite::SMTP>>> Net::SMTP(2.29) MIME::Lite::SMTP>>> Net::Cmd(2.26) MIME::Lite::SMTP>>> Exporter(5.58) MIME::Lite::SMTP>>> IO::Socket::INET(1.29) MIME::Lite::SMTP>>> IO::Socket(1.29) MIME::Lite::SMTP>>> IO::Handle(1.25) MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 220 CAS1.microsoft.exchange.server + Microsoft ESMTP MAIL Service ready at Mon, 4 May 2009 13:39:01 +0530 MIME::Lite::SMTP=GLOB(0x1b5e3e4)>>> EHLO localhost.localdomain MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-CAS1.microsoft.exchange.server + Hello [172.16.4.115] MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-SIZE 10485760 MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-PIPELINING MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-DSN MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-ENHANCEDSTATUSCODES MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-STARTTLS MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-AUTH GSSAPI NTLM MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-8BITMIME MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250-BINARYMIME MIME::Lite::SMTP=GLOB(0x1b5e3e4)<<< 250 CHUNKING No SASL mechanism found at C:/Perl/site/lib/Authen/SASL.pm line 74
The server through which I am trying to send the email is an Microsoft exchange Server.

Just FYI - I generally use 'Thunderbird' as my email client I am being able to send/receive emails through exchange server.

Under SMTP section following settings are configured:

Port: 25
Use secure connection: No

On the other hand to receive emails I am using port 993 through SSL


In reply to Unable to use 'MIME::Lite' though exchange server. by paragkalra

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!
  • 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:
    & &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.