Since the shell script was recently written in CentOS5.6 and the Mail sending function was required, I found the mutt software. It is a text-interface-based mail client, which is very small but powerful. it can be used to read and write, reply, save, and delete your emails. it can be used in linux command line...
Since the shell script was recently written in CentOS5.6 and the Mail sending function was required, I found the mutt software. It is a text-interface-based email client that is very small but powerful. it can be used to read and write, reply, save, and delete your emails, it can send and receive email attachments in linux command line mode. For more usage instructions, refer to the official website: http://www.mutt.org When installing the operating system www.2cto.com 1. mutt, mutt is installed by default in Linux, and CentOS is no exception. You can use which mutt to view the mutt installation path. if not, run yum install mutt on the command line to install mutt. the newer mutt version is. 4.2.2-3.0.2.el5 after mutt is installed, you can have a good manual under/usr/share/doc/mutt. 2. after the mutt configuration is installed, run the find command to find the file Muttrc. find/-name Muttrc and find the file at the location of/etc/Muttrc, instead of the/root /. muttrc file. In this case, I first configured the/etc/Muttrc file and copied it to/root to change the file name to. muttrc. In fact, it is found that some systems do not need to copy the. muttrc file to/root, or they can correctly send and receive emails. By default, mutt calls/usr/sbin/sendmail to send emails. you can also configure the following configuration for sending emails to the/etc/Muttrc file by using msmtp, I append the following configuration at the end of the file: www.2cto.com set from = youremail@inc.com set envelope_from = yes my_hdr From: youremail@inc.com my_hdr Reply-To: youremail@inc.com ignore headers * unignore headers from 3. run the ps-ef | grep sendmail command to check whether the sendmail service is enabled, if it is not started, run echo "test" |/usr/bin/mutt-s "email send at $ dd on the shell command line! "Youremail@inc.com soon you will receive an email from the root in your mailbox. finally, paste the mutt syntax mutt [-hnpRvxz] [- <文件> ] [-B <地址> ] [-C <地址> ] [-F <邮件文 件> ] [-F <配置文件> ] [-H <邮件草稿> ] [-I <文件> ] [-M <类型> ] [-S <主题> ] [Email address] parameter: www.2cto.com- <文件> Add an additional file to the email. -B <地址> The recipient address of the encrypted copy. -C <地址> The recipient address of the copy. -F <邮件文件> Specifies the mail file to load. -F <配置文件> Specify the setting file of the mutt program, instead of reading the preset. muttrc file. -H: displays help. -H <邮件草稿> Sends the specified email draft. -I <文件> Insert the specified file into the email. -M <类型> Specifies the default mail type. -N do not read the program cultivation File (/etc/Muttrc ). -P, after editing the email in mutt, does not want to send the email immediately, you can suspend sending the email. -R: open the mail file in read-only mode. -S <主题> Specifies the subject of the email. -V displays the version information of mutt and the parameters given when the file was compiled. -X simulates the editing method of mailx. When the-z parameter is used together with the-f parameter, if the mail file does not contain the Mail, the mutt is not started.
Author sharong
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.