muquit / mailsend

A program to send mail via SMTP from command line
Other
294 stars 68 forks source link

problem with mail body and attachment #111

Open RafalKarol opened 7 years ago

RafalKarol commented 7 years ago

I'd like to send mail with mailbody and attachment, mailbody is a text file, and attachment is a pdf file, I tried many combinations, but it doesn't work. I have only body mail with many characters, not attachment as pdf file

mailsend1.19 -to xx@xx.com -from a.b@xx.com -port 25 -smtp smtp.xx.com -sub "Test" +cc +bc -user xxx@xx.com -pass xxx -mime-type "text/plain" -enc-type "none" -disposition "inline" -attach mailbody.txt -mime-type "application/pdf" -enc-type "base64" -disposition "attachment" -attach test.pdf

Below a part of mail body: "??????,

Regards, Rafal--1KQbRgRQPNYVwdML Content-Type: application/pdf; charset=utf-8 Content-Disposition: attachment; filename="test.pdf" Content-Transfer-Encoding: base64

JVBERi0xLjQKJcfsj6IKNCAwIG9iago8PC9MaW5lYXJpemVkIDEvTCAxMjk2OC9IWyAxMDM3"_

muquit commented 7 years ago

Message body and attachments can not be mixed. You can attach the text file as inline and most mail readers will probably display it inline. Please have a look at FAQ# 1. Thanks.

RafalKarol commented 7 years ago

please, look at my example, I don't use parameter -M, I have two attachments, and I'd like the text file will be inline, and pdf file will be as attachment, and it doesn't work, these two attachments are inline

muquit commented 7 years ago

What platform are you on? I suspect it could be the bug #108, which is fixed in the develop branch. If you are on Linux/Unix you can pull the branch and try it. I did not get a chance to compile the fix on Windows yet.

Thanks

RafalKarol commented 7 years ago

windows, so I have to wait, thank you for the information,

muquit commented 7 years ago

I uploaded v1.20b for Windows in releases section. However, I could not reproduce the issue even with v1.19 from Windows 10 with gmail. Text attachment shows up inline. For text file, with -disposition inline, I tried -enc-type "none" -cs "utf-8", worked fine. Also tried -enc-type "base64", worked fine as well.

RafalKarol commented 7 years ago

I tested with v1.20b for Windows and it works fine. I don't have problem like with v1.19. Thank you very much for the help. Version 1,20b solved my problems.

ArtZL commented 6 years ago

MailSend v 1.20b Windows 10

Does not work with both -msg-body and -attach. I thought 1.20b was to fix this.

mailsend -v -f support@mysite.com -smtp smtp.mysite.com -port 587 -t someone@somewhere.com -sub "This is the Subject" -name "from Art" -rt support@mysite.com -auth -user support@mysite.com -pass mypwd -msg-body body.txt -attach "test.pdf"

comeback2000 commented 6 years ago

I have same issue i am getting only BODY content and attachment got missed. I am using cygwin to send mail. Any one got resolve this issue

mailsend -v -f test@mysite.com -smtp smtp.mysite.com -t someone@somewhere.com -sub "This is the Subject" -msg-body "body.txt" -attach "sample.txt"

q2956 commented 5 years ago

I have the same issue.

Either the parameter -msg-body OR -attach works. Not both together.

Is there a Workaround?

ArtZL commented 5 years ago

It’s the “disposition settings”. Took me months to figure this out. And the order of the parameters might matter.

mailsend -f "support@FromURL.com" -t person@ToURL.com -rt me@ReplyToURL.com -starttls -port 587 -auth-plain -smtp mail.smtpServer.com -user someone@UserURL.com -pass "Password" -sub "Testing Email" -disposition attachment -attach "attachment.pdf" -disposition inline -attach "body.txt" -log "C:\temp\log.txt"

      Art Lieberman

From: q2956 Sent: Saturday, January 5, 2019 6:08 AM To: muquit/mailsend Cc: ArtZL ; Comment Subject: Re: [muquit/mailsend] problem with mail body and attachment (#111)

I have the same issue.

Either the parameter -msg-body OR -attach works. Not both together.

Is there a Workaround?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.