Centos登录SMTP发件服务器发送邮件
安装msmtp服务
yum install -y msmtp
写配置文件,到路径位置 ~/.msmtprc
defaults auth on tls on tls_starttls on tls_certcheck on logfile ~/.msmtp.log account Teddyou host mail.teddyou.com port 587 auth login user [email protected] password your_email_password from [email protected] account default : Teddyou
此配置文件针对的加密方式是STARTTLS
配置权限(非必需)
chmod 600 ~/.msmtprc
发送测试邮件
echo -e "Subject: Test Email\n\nThis is a test email body." | msmtp -a Teddyou -- [email protected]
部署完成
发表评论