In linux bash, if you use mailx to send Chinese content and display it as an attachment, the mailx version is resolved. Here, mail is directed to the mailx Program # ll/bin/mail lrwxrwxrwx by default. 1 root 5 October 2011/bin/mail-> mailx www.2cto.com # mail-V 12.4 7/29/08 mail. rc configuration, set the external smtp server cat/etc/mail. rc # set sendcharsets = iso-8859-1, UTF-8 set from = demo@163.com smtp = smtp.163.com set smtp-auth-user = demo smtp-auth-password = demopassword smtp-auth = login send mail, content cannot be seen in the QQ mailbox. Only one attachment is seen. The content in the attachment is our Chinese content #! /Bin/bash... echo "Chinese content test! "|/Bin/mail-s" Chinese title "xxx@qq.com...
Www.2cto.com, however, it is normal to manually enter the command to receive the mail content. This may be caused by the failure of the system encoding environment when bash is running. View System encoding environment # locale LANG = zh_CN.gb18030 LC_CTYPE = "inherit" LC_NUMERIC = "inherit" LC_TIME = "inherit" LC_COLLATE = "inherit" LC_MONETARY = "inherit" LC_MESSAGES = "inherit" LC_PAPER = "canonical" LC_NAME = "canonical" LC_ADDRESS = "zh_CN.gb18030" LC_TELEPHONE = "canonical" LC_MEASUREMENT = "canonical" LC_IDENTIFICATION = "canonical" LC_ALL = www.2cto.com change the sending command #! /Bin/bash export LANG = zh_CN.gb18030 echo "Chinese content test! "|/Bin/mail-s" Chinese title "xxx@qq.com... is to receive the mail is displayed as Chinese. Author: islandstar