mailsend-go
mailsend-go copied to clipboard
Behaviour with charsets and attachments
Hi, First of all, I would like to thank your work regarding mailsend-go. I was using mailsend in the past but, as you recommend, I am considering to move to mailsend-go. I am writing to you as I am getting some problems regarding charsets and attachments (using current version 1.0.9). To sum up, my need is to send emails with a body that is a html file and, optionally, attach some documents (let's say pdf files). Furthermore, I need to use "ISO-8859-1" charset.
- My first problem is with the charset. I use words that contain accent vowels so, for testing, I use the same text both in subject and body: "Número de documento: ". I have tried different options and I got these results (an image is attached) :
The subject is not well managed regarding charset. This is the text showed in the subject: "Número de documento: TEST/20-000001".
- The body of the mail works well some cases:
Using body param with a html file mailsend-go.exe -t [email protected] -smtp smtp.office365.com -port 587 -f [email protected] -sub "Número de documento: TEST/20-000001" auth -user [email protected] -pass PASSWORD -cs "ISO-8859-1" body -file "C:/simple.html" -mime-type text/html
Using attach param with a html file inline. mailsend-go.exe -t [email protected] -smtp smtp.office365.com -port 587 -f [email protected] -sub "Número de documento: TEST/20-000001" auth -user [email protected] -pass PASSWORD -cs "ISO-8859-1" attach -file "C:/simple.html" -mime-type text/html -inline
- The body of the email does not work well:
Using body -msg param. mailsend-go.exe -t [email protected] -smtp smtp.office365.com -port 587 -f [email protected] -sub "Número de documento: TEST/20-000001" auth -user [email protected] -pass PASSWORD -cs "ISO-8859-1" body -msg "Número de documento: TEST/20-0000001"
- My second problem is with attachments in a specific case: using at the same time a html file WITH inline and a pdf file WITHOUT inline. In this case, both file are included in the email as inline. The expected output would be that the pdf file was included as an attachment in the email. Here is the command I am using: mailsend-go.exe -t [email protected] -smtp smtp.office365.com -port 587 -f [email protected] -sub "Número de documento: TEST/20-000001" auth -user [email protected] -pass PASSWORD -cs "ISO-8859-1" attach -file "C:/simple.html" -mime-type text/html -inline attach -file "C:/a.pdf" -mime-type application/pdf
The html file (simple.html but uploaded with txt extension) is attached in case you want it to test:
Again, thank you for your effort and kind regards, Marcos Palacios
In addition to this, I have tried to use "UTF-8" and, in this case, subject is properly showed but the body of the email (the html file) does not manage well the accent vowels:
mailsend-go.exe -t [email protected] -smtp smtp.office365.com -port 587 -f [email protected] -sub "Número de documento: TEST/20-000001" auth -user [email protected] -pass PASSWORD -cs "UTF-8" body -file "C:/simple.html" -mime-type text/html
Just a hunch, maybe your command line input is incorrect. Did you change the command line character table? See this: https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/chcp
I have already reviewed it and my current active code page is 850 (Multilingual). I cannot get your point regarding the command line input.
I have completed my tests regarding charsets in the latest version (v1.0.9).
Definitely I was not able to make it work with ISO-8859-1 charset. However, my problems with accent vowels is fixed using a "trick" with the html file. Using a UTF-8 charset in the command line, the subject with accent vowels is properly showed.
On the other hand, the body is also well showed if the html file has been previously saved with a UTF-8 codification. This is, I open the same html file with the notepad and I use "Save as" option, choosing UTF-8 codification. This works using body -file tags but it does not work using attach tag with inline.
My command line are:
mailsend-go.exe -t [email protected] -smtp smtp.office365.com -port 587 -f [email protected] -sub "Número de documento: TEST/20-000001" auth -user [email protected] -pass PASSWORD -cs "UTF-8" body -file "C:/simple.html" -mime-type text/html
mailsend-go.exe -t [email protected] -smtp smtp.office365.com -port 587 -f [email protected] -sub "Número de documento: TEST/20-000001" auth -user [email protected] -pass PASSWORD -cs "UTF-8" body -file "C:/simple_saved_as_utf8.html" -mime-type text/html
mailsend-go.exe -t [email protected] -smtp smtp.office365.com -port 587 -f [email protected] -sub "Número de documento: TEST/20-000001" auth -user [email protected] -pass PASSWORD -cs "UTF-8" attach -file "C:/simple_saved_as_utf8.html" -mime-type text/html -inline
Said this, it would be great to be able to use other charsets, as it is mentioned in #12
Regards, Marcos