Ubuntu command line Send mail

Source: Internet
Author: User
Tags auth

The article mainly refers to the reference http://www.cnblogs.com/276815076/archive/2011/10/11/2207214.html

Verify send success, please try boldly, but the consequences of the ego ha.

Needless to say first install software, Ubuntu everybody knows ha, the fool type sudo apt-get install mutt msmtp, all default settings on the line.

Then start a variety of configuration, very simple, do not want to trouble, you can copy, of course, I also CTRL + C

MUTT
System Global Settings/etc/muttrc, if you are using a system user, you can set it in ~/.MUTTRC.

VI. MUTTRC
Set sendmail= "/usr/bin/msmtp"
Set Use_from=yes
Set Realname= "Fengyubin"
Set from=fyb@163.com
Set Envelope_from=yes msmtp
Create ~/.MSMTPRC and ~/.msmtp.log, respectively, for configuration and log files.
VI. MSMTPRC

Account Default
Host smtp.163.com from fyb@163.com
Auth Plain user fyb password 123456 logfile ~/.msmtp.log because the password is plaintext, we need to modify the permissions for this file.
chmod MSMTPRC Touch ~/.msmtp.log View whether the SMTP server supports authenticated TLS encryption:

Typing the following command: MSMTP--host=smtp.163.com--serverinfo Carriage return

SMTP Server at smtp.163.com (m5-86.163.com [202.108.5.86]), port 25:
163.com Anti-Spam GT for Coremail System (163com[20050206])
Capabilities:
Pipelining:
Support for command grouping for faster transmission
AUTH:
Supported Authentication methods:
PLAIN LOGIN

Here, you can use Mutt to send mail, let's test it.

echo "Test" |mutt-s "my_first_test" * * * * @gmail. com

Go to the mailbox and see if it works.

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.