Edit/etc/mail.rc Add to Last:
Set [email protected] #发送邮箱地址
Set smtp=smtp.sina.com #发送邮箱服务器
Set [email protected] #登录名
Set Smtp-auth-password=test #登录密码
Set Smtp-auth=login #登录认证方式
After the configuration is complete, test:
echo "Test" |mail-s "test" [email protected]
If you are unable to receive mail normally, you can view it by command:
mail-v [email protected]
Subject:test #输入标题
Test #输入内容 (Ctrl +d) ends
EOT
Resolving host smtp.sina.com ... done.
Connecting to 219.142.78.230 ... connected.
Smtp-2-31.smtpsmail.fmail.yf.sinanode.com ESMTP
>>> EHLO Nagios
250-smtp-2-31.smtpsmail.fmail.yf.sinanode.com
250-auth LOGIN PLAIN
250-auth=login PLAIN
250-starttls
8BITMIME
>>> AUTH LOGIN
334 Vxnlcm5hbwu6
>>> ndazntk4mubzaw5hlmnvbq==
334 Ugfzc3dvcmq6
>>> exvtaw5zdgfsba==
235 OK Authenticated
>>> MAIL From:<[email protected]>
Ok
>>> RCPT To:<[email protected]>
Ok
>>> DATA
354 END data with <CR><LF>.<CR><LF>
>>>.
OK queue ID 6918754530958
>>> QUIT
Open mailbox successfully received mail
This article is from the "Shell" blog, be sure to keep this source http://zhizhimao.blog.51cto.com/3379994/1924364
Linux Configuration Outgoing Mail