Linux SendMail sending mail using external SMTP service

Source: Internet
Author: User

Objective

Now SendMail service is the Linux system comes with service, default may not boot.

This article does not explain how to build a local mail server, but only as a client, using the external SMTP service to send mail, so there is no need to start the SendMail service.

Study notes for review.

1.Sendmail Configuration

Configure mailbox authentication information for a message to occur

Vi/etc/mail.rc

---Add the following content---

1 set [email protected]
2 set smtp=mail.your-domain.com
3 set smtp-auth-user=yourname
4 set smtp-auth-password=yourpasswd
5 set smtp-auth=login

2. Test the Send mail feature

There are three ways to send mail SendMail (1) using the shell directly when the editor (2) uses the pipeline to send mail (3) Use the file for mail

(1) use the shell directly as an editor and use "." When you are finished editing the content. End Edit and send

#mail-S "zhuti" [email protected]

Message more

.


(2) Use the pipeline to send mail, when you finish editing the content, enter to send the message

#echo "Hell,this is the content of Mail.welcome to local.com" | Mail-s "This is mail test" [email protected]


(3) using the file for mail sending, this method is to send the contents of the file as the content of the message

#mail-S "Hello from local.com by file" [email protected] < file


For more sendmail parameters see here http://www.courier-mta.org/sendmail.html, or the man sendmail in the shell for help.

3.sendmail Send Attachment Configuration

In many cases, we also need to use the mail to send attachments, the use of Linux under the Mail command to send attachments is also very simple, but first need to install the Uuencode software package, the program is to encode the binary files to be sent by mail, install the package on CentOS as follows:

#yum Install Sharutils

After the installation is complete, the attachment can be sent, and the command format for sending the attachment using SendMail is as follows

。。。。。


This article is from the "A-B-C" blog, reproduced please contact the author!

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.