1, install mailx
yum install mailx -y
2, edit the configuration file
vim /etc/mail.rc
set [email protected]
set smtp=smtp.qq.com
set [email protected]
set smtp-auth-password=QQ授权码
set smtp-auth=login
3, the test message
echo test |mailx -v -s "test" [email protected]
Commonly used commands (commonly used e-mail prompt Command)
H: View the message header.
d: Use this command to add numbers you can delete the specified message.
f: view the message at the current cursor points to.
n: Jump to specified message number.
w: save the message information to a file, save the attachment to a separate file.
q: Quit and read messages stored in the file ~ / mbox in.
x: exit without holding operation before, such as deleting messages and so on.
!: Allows the use of shell commands.