Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: SMTP auth() command not supported on smtp.live.com

by mbethke (Hermit)
on Jan 17, 2013 at 04:10 UTC ( #1013700=note: print w/ replies, xml ) Need Help??


in reply to SMTP auth() command not supported on smtp.live.com

Apart from what davido said: I'm quite sure your problem is due to them (sensibly) requiring TLS for LOGIN (and you should probably use Port 587 for that). You'll have to manually use Net::SMTP::SSL to send the mail prepared by MIME::Lite because the latter doesn't support dependency injection, i.e. has no way for the user to specify their own Net::SMTP API-compatible module.


Comment on Re: SMTP auth() command not supported on smtp.live.com
Re^2: SMTP auth() command not supported on smtp.live.com
by lighterjoul (Initiate) on Jan 17, 2013 at 08:34 UTC
    Hi, mbethke,

    I had changed the port No. however, I still get the error.

     $msg->send('smtp','smtp.live.com', Port => 587, AuthUser=>'username@hotmail.com', AuthPass=>'passwords');

    Meanwhile, I had tested the Net::SMTP::TLS, and in that case, I can sent the text messages by hotmail, but I can not send the attachements(I can get the attachements, but badly encoded or bad file size etc), can you check my codes? Many thanks..

    use strict; use MIME::Lite; use Getopt::Std; use MIME::Base64; use Authen::SASL; use Net::SMTP::SSL; use Net::SMTP::TLS; my $un='username@hotmail.com'; my $pw='passwords'; my $mh='smtp.live.com'; my $pt=25; my $from = 'username@hotmail.com'; my $to = 'touser@gmail.com'; my $mailer = new Net::SMTP::TLS( $mh, Port => $pt, User => $un, Password => $pw, Timeout => 60, ) or die "Cannot create a TLS mailer instance!\n"; $mailer->mail($from); $mailer->to($to); $mailer->data(); my $msg = MIME::Lite->new( From => $from, 'Reply-to' => $from, To => $to, Subject => "test", Type => 'multipart/related' ) or die "Cannot create a new email instance!\n"; $msg->attach( Type => 'TEXT', Data => "test messages", ) or die "Error adding TXT: $!\n"; $msg->attach( Type => 'aplication/pdf', Path => 'test.pdf', Disposition => 'attachment' ) or die "Error adding PDF: $!\n"; $mailer->datasend($msg->as_string); $mailer->dataend(); $mailer->quit();

      You at least have a typo in your MIME-Type:

      Wrong : Type => 'aplication/pdf', Correct : Type => 'application/pdf',

      I don't know if that's the cause for the incorrect/corrupted attachments.

        opps... very sorry for my carefulless...

        I can get the pdf attachment right now, but the pdf size is not correct, the original pdf size is 42.2KB, but the attachment size in the email is 11.4KB, and that pdf can not be opened, very strange... I guess if the MIME::Lite destroied the PDF file?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013700]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2014-12-20 20:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (98 votes), past polls