Linux under MAIL/MAILX command Send mail

Source: Internet
Author: User

Recently, it is quite new to see that the report generated by the Java program is often sent with the MAIL/MAILX command in the project. The following is a brief introduction to the following MAIL/MAILX command usage. This article has the same effect as the Mail command Example (MAIL/MAILX).

Send the printed content as standard input to the Mail command
[Email protected] www]# echo "Hello, Tough" | mail-s "Tough ' greeting" [email protected]

-S for the theme, "< Mail.txt" means to mail.txt content as the message body
[Email protected] www]# mail-s "Tough ' s greeting" [email protected] < Mail.txt

You can also use the output of the cat mail.txt as the standard input for the Mail command, as the message body
[Email protected] www]#cat mail.txt | mail-s "Tough ' s greeting" [email protected]

-C indicates the address of the CC ([email protected],[email protected]), [email protected] is the address sent directly
[Email protected] www]# mail-s "Tough ' greeting"-c "[email protected],[email protected]" [email protected] "< Mail.txt

Test found, with uuencode hair attachments, in the mailbox is not normal display, is a number of "garbled", need additional decoding command, in short, not very useful
[Email protected] www]# uuencode/home/tough/pic/a.png "tough ' s Photo" | mail-s "pic Test" [Email protected]

Fake sender address method seen on the web (---f followed by sender address,-F sender name), and the result is less than ideal after testing
[Email protected] www]# mail-s Tough [email protected] < mail.txt---f [email protected]-F Tough

Detailed reference

Https://www.ibm.com/support/knowledgecenter/zh/ssw_aix_61/com.ibm.aix.cmds3/mailx.htm

Linux under MAIL/MAILX command Send mail

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.