1, edit the user's home directory of the. muttrc file, set the letter environment.
Copy Code code as follows:
# CAT/ROOT/.MUTTRC
Set Envelope_from=yes
Set from=owinux@sina.cn
Set Realname= "Owinux"
Set Use_from=yes
Set Rfc2047_parameters=yes
Set charset= "Utf-8"
2, the letter script
Copy Code code as follows:
# Cat Automail.sh
#!/bin/sh
# automail.sh
Dir=/root/owinux
mailcontent= $DIR/mailcontent
> "$mailcontent"
Echo-e "Owinux, hello!\n" >> $mailcontent
Echo-e "\ t attachment for ' date +%y-%m-%d ' Equipment daily inspection report, please check. ">> $mailcontent
Cat Mailcontent | /usr/bin/mutt-s "Equipment Daily inspection report"-a/root/owinux/report.xls owinux@126.com-c owinux@yeah.net-c owinux@sina.com
3. Brief description:
-S: Specify topic
-A: Accessories
-C: CC, need to use more than one-c option
Use the above letter environment to ensure that when the page view the message, the attachment name does not appear garbled.
where the. Muttrc's "set from" can be arbitrarily set, can be non-existent email address, of course, the best.
Like what:
Copy Code code as follows:
However, it is not the correct e-mail address you set up to be able to send success.
Copy Code code as follows:
I registered a new owinux@126.com, then set the set from to Owinux@126.com, without success.
The reason is that 126 mailbox reported a MI:SPF error, connect to 126 corporate Retreat Letter FAQ? Found
Copy Code code as follows:
MI:SPF Letter IP is not sent to the domain of the SPF license.