muquit / mailsend

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

Embedding images #64

Closed paolo573229 closed 9 years ago

paolo573229 commented 9 years ago

Mailsend is perfect. I cannot (using mailsend v1.17b15 (Windows)) use correctly -embed-image: If I use it, I cannot set Content-ID correctly so I cannot reach it in my html text I tried also with -aname -x-attachment-id -content-id -filename parameters, but unsuccessfully. Using -attach works correctly, is connected but attachment appear in mail, that is unwanted. Where is the error ? thankyou in advance

muquit commented 9 years ago

I added 'How to embed images in HTML?' in the FAQ. test/ directory has the scripts and the HTML files used to send the mails. Please let me know it it helped.

Thanks.

paolo573229 commented 9 years ago

Using the following syntax (perl script) I send my mail with images in correct place. Only they appear also in attacment list (unwanted). If I use -embed-image I dont find em in attachment list but I cannot guess content-id of included file so I cant refer to them in html. Maybe the solution could be to extend content-id usage also to embed-image. Thanks in advance for assistence, Paolo

...... -auth-login -port 587 -starttls -cs ISO-8859-1 -mime-type text/html -enc-type "none" -sub $d -M \"MAPI: $d \n Size = $size\" -mime-type \"text/html\"
-M \"other info\" -M \" <a href=https://github.com/muquit/mailsend>mailsend noimg</a> <a href=https://github.com/muquit/mailsend/blob/master/doc/examples.mediawiki >mailsend examples </a>
cip\" -attach $d -mime-type image/png -enc-type "base64" -content-id "328.png" -cs "none" -attach "328.png" -mime-type image/gif -content-id "b68.gif" -cs "none" -attach "b68.gif"

muquit commented 9 years ago

Looks like you missed -content-type "multipart/related", this must be specified to relate cids. Please have a look at the script test/test_embed2.sh for an example.

paolo573229 commented 9 years ago

I thank you so much. Now it works I understood I've not to use -M together with -include as first item to get the result, Happy to have met you Paolo