Linux version: CentOS 6.7//Can be viewed using lsb_release-a
First, modify the/etc/mail.rc//on the last side of the line, you can also echo >>
Set [email protected]//your own real e-mail address
Set smtp=smtp.exmail.qq.com//In mailbox settings, client settings, Setup method, send server
Set [email protected]//real address of your own email
Set smtp-auth-password=123456//own email password
Set Smtp-auth=login
: Wq
Two, to here has realized the implementation of external mailbox sent mail, you can command line input
echo "Test Mail" | Mail-s "Test" [email protected]
########################################################################
You can also write scripts:
#!/bin/bash
User= "
Target 1 123456789@qq. com
Target 2 [email protected]
......
"
Userlist= ' Echo-e "${user}" | awk ' {print $} '
Echo $userlist
Mail-v-S "Test Mail" $userlist < Test.txt
: Wq
which
-V Show More information
-S Message header
Test.txt is the content you want to enter the message
Then CRONTAB-E edit the scheduled task, you can implement the scheduled email!
This article is from the Linux OPS blog, so be sure to keep this source http://dywwen.blog.51cto.com/12715220/1916019
Implementing shell bulk mail scripts in Linux