Linux mail to send another method--sendemail use:
Download SendEmail
wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.55.tar.gz
The code is as follows |
Copy Code |
TAR–ZXVF sendemail-v1.55.tar.gz CD sendemail-v1.55 CP Sendemail/usr/local/bin chmod 0755/usr/local/bin/sendemail /usr/local/bin/sendemail–f 123456@qq.com–t 123456@qq.com–s smtp.qq.com–u "The Hefei Network letter" –xu username–xp 123456–m "The Hefei network letter, this is the inside Let's do it. " |
Explain:
-F indicates the sender's mailbox
-T indicates the recipient's mailbox
-S indicates the domain name or IP of the SMTP server
-U represents the subject of a message
-xu the user name that represents SMTP authentication
-XP represents the password for SMTP authentication (note that this password appears to be limited, such as I can not be properly identified with D!5neyland)
-M represents the contents of a message
Other methods
There are three ways to send messages using the Mail command:
1. Use Shell as editor directly
The code is as follows |
Copy Code |
Mail-s "Hello from mzone.cc by Shell" Admin@mzone.cchello,this are the content of Mail.welcome to www.mzone.cc |
The first line is the input of the command,-s to indicate the subject of the message, the following admin@mzone.cc is the recipient of the message, enter the line after the command return, will enter the text of the message, we can enter any text, such as the two lines above. When the message body input completes, needs to press Ctrl+d to end the input, at this time will prompt you to enter the CC address, namely the Mail cc address, does not have the direct return to complete the mail to send.
2, use the pipeline to send mail
The code is as follows |
Copy Code |
echo "Hello,this is the content of Mail.welcome to www.mzone.cc" | Mail-s "Hello from mzone.cc by pipe" admin@mzone.cc |
Use the pipeline to directly line the command to complete the message sent, where ECHO is the message body.
3, use the file to send mail
The code is as follows |
Copy Code |
Mail-s "Hello from mzone.cc by file" Admin@mzone.cc < Mail.txt |
After using the above command, we can send the contents of the Mail.txt file as the content of the message to admin@mzone.cc.