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---
2 |
set smtp=mail.your-domain.com |
3 |
set smtp-auth-user=yourname |
4 |
set smtp-auth-password=yourpasswd |
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!