mailsend icon indicating copy to clipboard operation
mailsend copied to clipboard

Attachment not sent

Open luca7766 opened this issue 10 years ago • 10 comments

I used -attach "filename.pdf" but into the email there's no attachment, here's the full command:

mailsend.exe -smtp out.myserver.com -f myaddress@ -t destination@ -sub "Testing" -mime-type "text/plain" -msg-body "C:\message.txt" -attach "c:\filename.pdf"

Tried even adding -mime-type "application/pdf" Tried even with gmail SMTP, mail send and received but with no attachments. Am I doing something wrong? Thank you.

luca7766 avatar Sep 30 '15 15:09 luca7766

-msg-body option is special, it can not be used with -attach. If you want the text file to be embedded, you can try to attach it as inline. FAQ#1 talks about it.

Thanks.

muquit avatar Sep 30 '15 15:09 muquit

Ok, i get it, so to send a text as mail body I should use:

-attach "textfile.txt","text/plain",i

and for a textfile plus a pdf attachment:

-attach "textfile.txt","text/plain",i -attach "document.pdf","application/pdf",a

I tried, but both solutions keep the attachment inside the source of the message, i can't see the clip of the pdf file for saving it and the text file is blank, but both files are sent, tested in thunderbird and webmail. Am I wrong again? Thanks

luca7766 avatar Sep 30 '15 16:09 luca7766

No, all the parameters must be inside quotes like -enctype "none" -attach "textfile.txt,text/plain,i" -enc-type "base64" -attach "document.pdf,application/pdf,a"

Or it can be more verbose, e.g.

-mime-type "text/plain" -enc-type "none" -disposition "inline" -attach "textfile.txt" -mime-type "application/pdf" -enc-type "base64" -disposition "attachment" -attach "document.pdf"

Each of the parameters overwrite the previous attachment's parameters. It's a good idea a clearly specify the parameters for each attachments, otherwise previous attachment's parameter will be used, which may or may not be appropriate.

Thanks.

muquit avatar Sep 30 '15 18:09 muquit

Tried with: -mime-type "text/plain" -enc-type "none" -disposition "inline" -attach "textfile.txt" and -enc-type "none" -attach "textfile.txt,text/plain,i" with no success, mail is sent and received but the text is not visibile, neither as attachment, but you can read it by viewing mail source under the lines:

Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

Same for the pdf attachment, am I wrong again? Thanks

luca7766 avatar Sep 30 '15 18:09 luca7766

I tested with gmail and outlook, text file shows up as inline and pdf as attachment. Can you send a sample mail to [email protected]?

Thanks.

muquit avatar Sep 30 '15 18:09 muquit

I just sent you a "Testing" message, the sender email is not real, but the issues happen even with my real email address. I attached an inline txt file and a pdf as attachment using: mailsend.exe -smtp out.alice.it -f [email protected] -t [email protected] -sub "Testing" -enc-type "none" -attach "C:\Users\Administrator\Desktop\testfile.txt,text/plain,i" -enc-type "base64" -attach "C:\Users\Administrator\Desktop\Document.pdf,application/pdf,a"

Tried even using gmail SMTP with proper auth

luca7766 avatar Sep 30 '15 19:09 luca7766

I've to look at it over the weekends. I'm sure I tested sending mails from windows before releasing 1.18.

Thanks.

muquit avatar Sep 30 '15 19:09 muquit

It's ok, thanks, not urgent, just figuring it out if it's me doing mistakes, thank you.

luca7766 avatar Sep 30 '15 19:09 luca7766

I just got a problem similar to this one: with mailsend1.16.exe the attachemnt arrive fine, with 1.17b15 or 1.18 it doesn't. One particular thing is that I've got a mail without body, just the attachment.

Thank you for your support.

cinghiuz avatar Mar 17 '16 09:03 cinghiuz

Hi,

same problem here. Seems to be a Kombination of mailsend versions and the provider one is using. Or maybe the difference between SSL and TLS. Have a look at the following 4 examples. The first one uses ms1.19 and hotmail and works fine, text and attachment OK. The second one uses ms1.19 and gmx and fails, no text and no attachment are part of the mail. Nevertheless the third one uses ms1.16 and everything works fine. This menas to me it's not really an issue of the provider. in the fourth case I removed the text, only a pdf should be attached, ms1.19 with GMX. In this case the attachment is sent but it is corrupted and cannot be read.

Hotmail uses TLS and GMX SSL Hope this helps.

Regards Reiner

mailsend1.19.exe -to XXXXXX -f [email protected] -smtp smtp-mail.outlook.com -port 587 -starttls -auth -user [email protected] -pass XXXXXX -sub "Mailsend 1.19 HOTMAIL" -cs "windows-1252" -attach "test.txt,text/html,i" -attach "test.pdf"

mailsend1.19.exe -to XXXXXX -f [email protected] -smtp mail.gmx.net -port 465 -ssl -auth -user [email protected] -pass XXXXXX -sub "Mailsend 1.19 GMX" -cs "windows-1252" -attach "test.txt,text/html,i" -attach "test.pdf"

mailsend1.16.exe -to XXXXXX -f [email protected] -smtp mail.gmx.net -port 465 -ssl -auth -user [email protected] -pass XXXXXX -sub "Mailsend 1.16 GMX" -cs "windows-1252" -attach "test.txt,text/html,i" -attach "test.pdf"

mailsend1.19.exe -to XXXXXX -f [email protected] -smtp mail.gmx.net -port 465 -ssl -auth -user [email protected] -pass XXXXXX -sub "Mailsend 1.19 GMX No text" -cs "windows-1252" -attach "test.pdf"

JimBobele avatar Jun 28 '16 14:06 JimBobele