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