How to send special characters via mail from a she

2019-02-03 03:13发布

I have a script that runs on cron that outputs some text which we send to the 'mail' program. The general line is like this:

./command.sh | mail -s "My Subject" destination@address.com -- -F "Sender Name" -f sender@address.com

The problem is that the text generated by the script has some special characters - é, ã, ç - since it is not in english. When the e-mail is received, each character is replaced by ??.

Now I understand that this is most likely due to the encoding that is not set correctly. What is the easiest way to fix this?

7条回答
可以哭但决不认输i
2楼-- · 2019-02-03 03:45

use the option -o message-charset="utf-8", like that:

sendemail -f your_email -t destination_email -o message-charset="utf-8" -u "Subject" -m "Message" -s smtp-mail.outlook.com:587 -xu your_mail -xp your_password
查看更多
登录 后发表回答