Linux under Mutt send Chinese mail garbled resolution method

Source: Internet
Author: User
Tags vps mysql backup

First, the installation of Mutt

1 yum-y Install SendMail

2 #需要安装sendmail并开启防火墙的25端口, if you need mail, 110 ports are open.

3 Yum-y Install Mutt

Second, configuration information

About the configuration information, there is a point to explain, many tutorials on the web, said, edit/root/.muttrc to modify the configuration file, I would like to say that, after the installation is complete, the/root directory does not. muttrc This hidden file, you can copy it from somewhere else, or create a new file yourself. Here I was copied.

You can find the muttrc this file by finding command, command the following found/-name muttrc, and then through the command CP/ETC/MUTTRC/ROOT/.MUTTRC copied to/root after the renamed to. MUTTRC, then you can edit the configuration text Pieces.

1 #如果你收到的邮件乱码, you can try setting the following information (added at the end of. Muttrc)

Set charset= "UTF-8"
# encoding used for outgoing mail
Set send_charset= "UTF-8"
# Display dates in Chinese format
Set locale= ' echo ' ${lc_all:-${lc_time:-${lang}} '
# solve the problem that the letters with no character encoding are displayed as garbled
Charset-hook ^us-ascii$ GB2312
# solve the problem that the title of the letter for UTF-8 is displayed as garbled
Charset-hook! UTF-8 GB2312
Set assumed_charset= "GB2312"
# solve the problem that the Chinese accessory name is garbled
Set Rfc2047_parameters=yes
Set Envelope_from=yes
Set Use_from=yes
Set from=xxxx@163.com
Set Realname= "My Name"

Third, mutt Mail send syntax:

Mutt [-hnprvxz][-a< File >][-b< address >][-c< address >][-f< mail file >][-F< profile >][-H< Mail Draft >][-i < file >][-m< Type] [-s< theme >][email address]
Parameters
-A < File > add additional files to the message.
-B < address > The recipient address of the specified blind copy.
-C < address > The recipient address of the specified replica.
-F < mail file > Specifies the message file to load.
-F < profile > Specifies the settings file for the Mutt program, and does not read the preset. muttrc file.
-h displays Help.
-H < message draft > send the specified message draft.
-I < file > insert the specified file into the text of the message.
-M < type > Specifies the default mail mailbox type.
-N Do not read the program implant file (/ETC/MUTTRC).
-P When you finish editing a message in mutt, and you do not want to send the message immediately, you can postpone sending the message.
-R opens the mail file in read-only mode.
-S < topics > Specify the subject of the message.
-V Displays the version information of the mutt and the parameters that were given when the file was originally compiled.
-X simulates how Mailx is edited.
-Z when used with the-f parameter, does not start mutt if there is no mail in the mail file.

Iv. examples

How to use

The simplest way to test
echo "Test" | Mutt-s "Title" xxxx@qq.com
With an attachment
echo "Test" | Mutt-s "MySQL backup"-a/mysql.tar.gz xxxx@qq.com
Read the information in the text as content
Mutt-s "Test" xxxx@qq.com
Add multiple Attachments
echo "Test" | Mutt-s "Web Backup"-a/mysql.tar.gz-a/web.tar.gz xxxx@qq.com

-S "MySQL backup" message parameters and headers

-a/mysql.tar.gz send the attachment parameters and paths

Read Mail.txt content for the content of the message, the content must be UTF8 code, otherwise garbled

3. Set Sender
Edit configuration file
Vi/etc/muttrc

Add the following to prevent being used as a spam message

Set from= "Mutt@vps.com"
Set Use_from=yes
Set envelope_from= "Yes"
Set Realname= "Mutt"

Mutt@vps.com is the address of the sender

Mutt is the sender.

Send message slightly slower, wait for a minute or longer to send success (scheduled backups can be done)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.