Linux under the mail to send SendEmail introduction

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.