Mailx
Mailx 是一个命令行邮件客户端,用于在 Linux/Unix 系统上发送和接收电子邮件。它是一种基于文本的工具,可以通过命令行界面和脚本进行操作。Mailx 可以通过 SMTP、POP3、IMAP 等协议来发送和接收邮件。
安装
yum install mailx -y
配置
vim /etc/mail.rc
set from=[email protected]
set smtp=smtps://smtp.qq.com:465
set smtp-auth-user=[email protected]
set smtp-auth-password=your_passwd
set smtp-auth=login
set ssl-verify=ignore
set nss-config-dir=/etc/pki/nssdb/
测试
echo "hello world" | mail -s "hello" [email protected]