Beefy Boxes and Bandwidth Generously Provided by pair Networks RobOMonk
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by lighterjoul (Initiate)
on Jan 17, 2013 at 09:03 UTC ( #1013732=note: print w/ replies, xml ) Need Help??


in reply to Re^3: SMTP auth() command not supported on smtp.live.com
in thread SMTP auth() command not supported on smtp.live.com

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?


Comment on Re^4: SMTP auth() command not supported on smtp.live.com
Re^5: SMTP auth() command not supported on smtp.live.com
by Corion (Pope) on Jan 17, 2013 at 09:26 UTC

    Aaah - I think I fought MIME::Lite on that front at one time. If you are on Windows, MIME::Lite does not always know to binmode the file used for an attachment. For .xls files, I now manually patch the mime type to application/vnd.ms-excel, which seems to do what I need, but I have old and disabled code that forced a binary attachment:

    $msg->attach( Type => $type, Disposition => 'attachment', Path => $filename, Filename => basename($filename), Binmode => 1, );

    If you are not on Windows, or that does not fix the problem, are you sure that the files to be attached have been written completely and their filehandles closed?

      Hi, Corion, Thanks for your reply. I'm on Windows, I don't know basename() function, so I changed to absolutely path, but I still got the same result, the pdf file is not correct.
      my $filename = "E:/test.pdf"; my $type = "application/pdf"; $msg->attach( Type => $type, Disposition => 'attachment', Path => $filename, Filename => $filename, Binmode => 1, ) or die "Error adding PDF: $!\n";
        opps.. it seems very interesting, in that program, the attachment size is always 11.4KB, no matter what file type and what file size...so strange..

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-04-17 02:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (437 votes), past polls