Use MUTT+MSMTP to send mail under Ubuntu

Source: Internet
Author: User
Tags mail account

Theory Introduction :

1. Mutt Introduction:

Mutt is a small but very powerful text-based mail client for Unix operating systems.

in simple terms, Mutt is a MUA (mail user agent), similar to Foxmail and Outlook, is not responsible for sending incoming messages.

2 . msmtp Introduction:

MSMTP is an SMTP client.

In the default mode, it transmits a mail to an SMTP server (for example at a free mail provider) which takes care of Furth ER delivery.
To use the this program with the Your Mail user agent (MUA), create a configuration file with the your mail account (s) and the Tell your M UA to call Msmtp instead of/usr/sbin/sendmail.

Translate only the second part "in order to use this program through MUA, you should create a profile using your account and tell the MUA program to call it instead of using the default SendMail"

Practical Operation :

First, MSMTP settings

    1. Installation: Apt-get Install MSMTP

    2. Configuration file Location:/ETC/MSMTPRC

    3. Configuration file MSMTPRC

      Defaults
      TLS on #这三行都是开始邮件的tls认证的
      Tls_starttls on
      Tls_trust_file/etc/ssl/certs/ca-certificates.crt
      Account Default
      Host smtp.exmail.qq.com #smtp服务器地址和端口
      Port 587
      Auth Plain #使用明文方式的授权信息
      User # "Your e-mail account"
      Password # "password"
      From # "Sender information [same as account name]
      Timeout Ten #设置网络超时
      Logfile/tmp/msmtp.log #日志

Second, Mutt set

    1. Installation: Apt-get Install Mutt

    2. Configuration file Location:/ETC/MUTTRC

    3. Configuration file: Muttrc

      Set sendmail= "/usr/bin/msmtp" #使用msmtp发送邮件

      Set Use_from=yes #设置邮件包含from的header信息

      Set realname= "Honey" #设置发送邮件的用户名 [alias/nickname of account]

      Set editor= "Vim" #使用vim启动mutt交互模式

      Set [email protected] #设置邮件from信息 [Use_from must be set]

      Set Envelope_from=yes

      Set Copy=no #是否保留消息副本

Third, mutt command line use

Example:

echo "For details see attachment" |mutt-a/root/a.txt-s "Daily Order Statistics"-c [email protected] \

--[email protected], [email protected]

Explain:

echo content is message body content

-a added attachment

-S Message subject

-C CC Mail person

"--" after "The content is the recipient" here because of newline, so add double bars "

This article is from the "learning is not transcribed" blog, please be sure to keep this source http://istyle.blog.51cto.com/6152438/1782680

Use MUTT+MSMTP to send mail under Ubuntu

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.