Centos 安装 Mailx (simply-sending-e-mails-with-mailx)

Mailx – The mail utilities listed above provide a comfortable, flexible environment for sending and receiving mail messages electronically.

1.升级yum并安装Mailx程序

yum update -y
yum install -y mailx

3.设置外部 SMTP 服务器中继电子邮件(配置mail.rc)

vi /etc/mail.rc
# Add QQ SMTP
set from=send_account\@qq.com   #send from mail address
set smtp=smtp.qq.com:465    #SMTP server domain
set smtp-auth-user=send_account@qq.com  #send account
set smtp-auth-password=account_password  #account password
set smtp-auth=login     #auth way
set nss-config-dir=/etc/pki/nssdb/

发送测试邮件

echo "Hello Mail Content" | mail -v -s "Message Subject" send_account@qq.com

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据