Use Mutt to send mail under Linux

Source: Internet
Author: User
Tags bz2

1, download, decompression msmtp

#wget http://downloads.sourceforge.net/msmtp/msmtp-1.4.30.tar.bz2?big_mirror=0

#tar JXVF msmtp-1.4.30.tar.bz2

2. Installation

#./msmtp-1.4.30/configure–prefix=/usr/local/msmtp

#make

#make Install

3. Configure MSMTP Account

Switch to, CD/USR/LOCAL/MSMTP

New Folder Etc,mkdir etc. Use VI to create a new file, enter Vi/usr/local/msmtp/etc/msmptrc, and edit the following:

Account Default

Host Smtp.163.com

From [email protected]

Auth Login

TLS off

User 18292079713

Password Xiaozhao1

Logfile/var/log/msmtp.log

ESC, save exit. Since password is plaintext, we need to modify this file's permissions chmod ETC/MSMTPRC

4. Installation Configuration Mutt

You can use the which mutt to view mutt installed paths If you do not have the #yum install Mutt

5. Edit the Mutt configuration file

Vi/etc/mutt, edit the total settings of the Mutt, and add a few lines at the end

Set sendmail= "/usr/local/msmtp/bin/msmtp"

Set Use_from=yes

Set Realname= "[Email protected]"

Set [email protected]

Set Envelope_from=yes

Set Rfc2047_parameters=yes

Set editor= "Vim"

Set charset= "Utf-8"

5. Testing

#/usr/local/msmtp/bin/msmtp-s

#/usr/local/msmtp/bin/msmtp-p

#echo "Test" |mutt-s "my_first_test" [email protected]

Combined with cron, you can achieve quite a few functions

Use Mutt to send mail under Linux

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.