Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

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

by Corion (Patriarch)
on Jan 17, 2013 at 09:26 UTC ( [id://1013735]=note: print w/replies, xml ) Need Help??


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

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?

Replies are listed 'Best First'.
Re^6: SMTP auth() command not supported on smtp.live.com
by lighterjoul (Initiate) on Jan 17, 2013 at 09:45 UTC
    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..

        I would try with a mail sender and recipient that are not hotmail, and I would also try sending a plain text attachment.

        If sending a plain text attachment works, then it is a problem with binmode not being applied, somewhere along the chain.

        If the problem goes away by not using Hotmail as the first SMTP server, or goes away by using a different recipient than Hotmail, then the problem is how Hotmail handles (this kind of) attachments.

        I had tried with other email account (not hotmail), however, things become more interesting. The orignal pdf file is cuted by many small files, each file has the same file name and file size(11.4KB). I guess that would not the problem of the email account, but the problem of the programe.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (8)
As of 2024-04-16 19:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found