Linux Learning notes: sending mail using external SMTP

Source: Internet
Author: User

On CentOS 6.3, you can use an external SMTP server to send mail by installing MAILX.

Yum Install Mailx-y


After the installation, edit the configuration file.

Mailx-v

12.4 7/29/08 <<MAILX Version number

RPM-QC MAILX

/etc/mail.rc << Online Many tutorials have written the configuration file name is Nail.rc, is it the old version of the reason?


Vi/etc/mail.rc

At the end of the file, add the following. (about this configuration file, man is no data, I also refer to the online tutorial, if you want to study, estimated to check Mailx's official website) pro-Test available

Set from= your e-mail address

Set smtp= your SMTP server address, which can be a domain name or IP

Set smtp-auth-user= user name for authentication

Set smtp-auth-password= password (clear text)

Set Smtp-auth=login << here as input

Here to illustrate, generally from and Smtp-auth-user is the same, but there are different times, depending on the circumstances, if not sure, try to stay consistent.


Send mail, Iostat.result is I used to do Test text file, Mailx have a lot of parameters available, such as-D is to test not really send

Cat Iostat.result | Mailx-v-a Iostat.result-s "iostat" [email protected]

This command down, you can send me a copy titled Iostat, Attachment for Iostat.result, the message body is iostat.result content of the message.


This article is from "Dad Coosh" blog, please be sure to keep this source http://coosh.blog.51cto.com/6334375/1733373

Linux Learning notes: sending mail using external SMTP

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.