echo “this is content” | mail -s “this is a title” bbmonkey62@163.com
通过echo命令来输入邮件内容“this is content”,这样就简单多了! 4、查看邮件
通过mail命令也可以查看收到的邮件,这个我就简单说一下吧,毕竟这个相对不常用,命令很简单,直接输入mail,会出现收到的邮件,每个邮件都对应一个序列号,如果要查看某封邮件,直接在?后输入数字序列号即可。
在?后输入help可以查看所有的参数,如下:
代码如下:
? help
mail commands
type <message list> type messages
next goto and type next message
from <message list> give head lines of messages
headers print out active message headers
delete <message list> delete messages
undelete <message list> undelete messages
save <message list> folder append messages to folder and mark as saved
copy <message list> folder append messages to folder without marking them
write <message list> file append message texts to file, save attachments
preserve <message list> keep incoming messages in mailbox even if saved
Reply <message list> reply to message senders
reply <message list> reply to message senders and all recipients
mail addresses mail to specific recipients
file folder change to another folder
quit quit and apply changes to folder
xit quit and discard changes made to folder
! shell escape
cd <directory> chdir to directory or home if none given
list list names of all available commands</p> <p>A <message list> consists of integers, ranges of same, or other criteria
separated by spaces. If omitted, mail uses the last message typed.