Sometimes you need to use local mail to send emails to the Internet. You need to customize the mail SMTP server.
By default, bin/mail will use local Sendmail to send emails. This requires that the local machine must install and start the sendmail service, which is very troublesome to configure and will cause unnecessary
Resource usage. By modifying the configuration file, you can use an external SMTP server to send emails without using Sendmail:
Modify/etc/mail. RC
Set [email protected] SMTP = smtp.domain.com
Set SMTP-auth-user = username SMTP-auth-Password = passwor SMTP-auth = Login
Note:
From is the sent email address.
SMTP is the address of the external SMTP server.
SMTP-auth-user is the user name authenticated by the external SMTP server.
SMTP-auth-password is the user password authenticated by the external SMTP server.
SMTP-auth is the mail authentication method.
After the configuration is successful, you can use
You can send an email to test it:
Mail-s "test" [email protected] <content.txt where-S is followed by the mail title, [email protected.pdf is the recipient's address, and content.txt contains the mail body
This article from the "IT migrant workers-Xiaofeng" blog, please be sure to keep this source http://wangfeng7399.blog.51cto.com/3518031/1436659