muquit / mailsend-go

mailsend-go is a multi-platform command line tool to send mail via SMTP protocol
Other
168 stars 16 forks source link

Option to easily specify embedded images via CID #3

Open rich-iannone opened 5 years ago

rich-iannone commented 5 years ago

Thank you very much for creating mailsend-go! It's really an important project and the only way to make cross-platform emailing (without dependencies) easy.

I'm adapting some code from mailsend to mailsend-go but having trouble understanding how to integrate content-id sections in the new project. The following statement worked well in mailsend (so long as <img> tags referenced the cid labels):

mailsend \
-from <from> \
-name <name> \
-t <to> \
+cc +bc \
-sub "Email Image Test; this is for testing image embedding with a variety of clients" \
-ssl \
-smtp smtp.gmail.com \
-port 465 \
-auth \
-user <username> \
-pass <password> \
-cs ISO-8859-1 \
-content-type "multipart/related" \
-mime-type text/html \
-disposition inline \
-enc-type "none" \
-attach "message_inlined.html" \
-mime-type image/png \
-enc-type "base64" \
-disposition inline \
-content-id "image_01" \
-cs "none" \
-attach "image.png"

Is it possible to easily do this in mailsend-go? If so, could you provide a quick example?