nail (mailx) 使用外部SMTP服务器配置

http://linux.chinaunix.net/techdoc/net/2009/07/08/1122449.shtml


/bin/mail会默认使用本地sendmail发送邮件,而通过修改配置文件可以使用外部SMTP服务器

修改/etc/nail.rc (/etc/mail.rc)
set from=emailAddress smtp=SMTPServer
set smtp-auth-user=username smtp-auth-password=password
set smtp-auth=login
其中emailAddress是你的邮箱地址,这个就是显示在发件人位置的东西
SMTPServer是SMTP服务器比如smtp.126.com
username, password用户名,密码
可以发送一封邮件测试一下:
mail -s "Test Email" [email protected] email.txt
其中-s后面的是邮件标题,[email protected]是收件人地址,email.txt里面是邮件正文,更多选项请man~

你可能感兴趣的:(nail (mailx) 使用外部SMTP服务器配置)