Introduction to sendEmail in Linux

Source: Internet
Author: User

This article summarizes four methods for sending emails in linux. For more information, see this article.

Another method for sending emails in Linux -- sendEmail usage:

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 ""-xu username-xp 123456-m ", this is the content"

Explanation:

-F indicates the sender's email address.

-T indicates the recipient's email address.

-S indicates the domain name or ip address of the SMTP server

-U indicates the subject of the email.

-Xu indicates the SMTP authentication user name

-Xp indicates the password for SMTP verification. (Note that this password seems to be restricted. For example, I use d! 5neyland cannot be correctly identified)

-M indicates the mail content

Other methods

You can use the mail command to send emails in the following three ways:

1. directly use shell as the editor

The Code is as follows: Copy code

Mail-s "Hello from mzone. cc by shell" admin@mzone.cchello, this is the content of mail. welcome to www. mzone. cc

The first line is the input command,-s indicates the subject of the mail, followed by the admin@mzone.cc is the recipient of the mail, enter this line of command and press enter, will enter the body of the mail writing, we can enter any text, such as the above two lines. After entering the body of the email, press CTRL + D to complete the input. At this time, you will be prompted to enter the Cc address, that is, the Cc address. If you do not press enter, the email will be sent.

2. Use MPs queues to send emails

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

You can use the pipeline to directly input this line of command to send the mail. The echo is the mail body.

3. Use files to send emails

The Code is as follows: Copy code
Mail-s "Hello from mzone. cc by file" admin@mzone.cc <mail.txt

 

With the imperative, we can send the contents of the mail.txt file to the admin@mzone.cc as the mail content

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.