Recently the company hand-tour of a test area service end old hanging, so the whole script monitoring, hang up to send mail and then automatically restart the service.
Start
First mail A look, the results prompt command not found (company system are custom installed) Hey, pack mail
Forget the mail package name look for we use Yum Search mail to find
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/5C/1D/wKiom1UakPvDicVCAAS34vidsxo303.jpg "title=" QQ picture 20150331202035.png "alt=" Wkiom1uakpvdicvcaas34vidsxo303.jpg "/>
Found the next install: Yum install mailx-y
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/5C/1E/wKiom1UakiXiYKbAAAEYfsdssRY287.jpg "title=" QQ picture 20150331202526.png "alt=" Wkiom1uakixiykbaaaeyfsdssry287.jpg "/>
Installation is successful!
Next edit the/etc/mail.rc direct file end line plus the following configuration:
Set [email protected] (email address sent)
Set smtp=smtp.xxx.com (SMTP server address of the sending mailbox)
Set smtp-auth-user=xxx (user name)
Set Smtp-auth-password=xxx (password)
Set Smtp-auth=login (login mode)
Then you can call with the Mail command to send mail with the specified mailbox, if there is the need to receive mail, please install the configuration SendMail
Linux uses the Mail command to send e-mail with the following syntax
Mail-s "motif" emailaddress
Example: Send a topic to the email [email protected] Server System error message
echo ' Date +%y_%m_%d_%h:%m ' System Erro | Mail-s "Server" [email protected]
This article is from the "left-handed" blog, make sure to keep this source http://mofeihu.blog.51cto.com/1825994/1627065
Linux send mail with mail command