Send mail using msmtp mutt Shell

Source: Internet
Author: User
Send mail using msmtp mutt Shell

1. Compile the software.

Software: http://sourceforge.net/projects/msmtp/files/msmtp/1.4.13/msmtp-1.4.13.tar.bz2/download

Tar jxvf msmtp-1.4.13.tar.bz2

./Configure -- prefix =/opt/msmtp

Make

Make install

2. Check where the configuration file is located.

[Root @ server bin] #./msmtp -- version

Msmtp version 1.4.13

TLS/SSL Library: None

Authentication Library: Built-in

Supported authentication methods:

Plain cram-md5 (external login)

IDN support: Disabled

NLS: enabled, localedir is/opt/msmtop/share/locale

System Configuration File Name:/opt/msmtp/etc/msmtprc ----- You need to manually create

User Configuration File Name:/root/. msmtprc

Copyright (c) 2007 Martin lambers and others.

This is free software. You may redistribute copies of it under the terms

The GNU General Public License.

There is no warranty, to the extent permitted by law.

3. Configure the msmtp configuration file.

[Root @ server] # mkdir-P/opt/msmtp/{etc, log}

[Root @ server] # cd/opt/msmtp/etc

[Root @ Server etc] # vi msmtprc (Add the following content)

# Set default values for all following accounts.

Ults

Logfile/opt/msmtp/log/msmtp. Log

# The SMTP server of the provider.

Account Sohu

Host smtp.sohu.com

From your_account@sohu.com

AUTH LOGIN

User your_account

Password your_password

# Set a default account

Account default: Sohu

Save and exit, and add the executable permission to this file: chmod + x msmtprc

When you get there, you 'd better test it first.

/Opt/msmtp/bin/msmtp test@gmail.com

Hello, test

CTRL + d

Tail-F/opt/msmtp/log/msmtp. log to check whether the operation is successful.

Then go to the preceding email to see if the email has been received.

4. Configure mutt

Download and install the mutt installation package: mutt-1.5.11.tar.gz

Tar-xzvf mutt-1.5.11.tar.gz

./Configure -- prefix =/opt/mutt & make install

[Root @ server bin] # vi/etc/muttrc (Add the following content)

Set Sendmail = "/opt/msmtp/bin/msmtp"

Set realname = "Actor"

Set use_from = Yes

Set Editor = "Vi"

5. Now we have everything done. Let's test it.

[Root @ server bin] # echo "test" | mutt-s "messages" test@gmail.com

Related Article

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.