安装sendmail:yum install -y sendmail
2.安装mail:yum install -y mailx
3.安装mutt:yum install -y mutt
4启动sendmail : systemctl restart sendmail
如果起不来,就需要停到postfix服务
systemctl stop postfix
systemctl start sendmail
发邮件的两种方式:
1、mail -s 'mail test' abc@qq.com < mailtest.txt
2、echo "this is my test mail" | mail -s 'mail test' abc@qq.com
报错
451 Sender address format error.
如果邮件提示发送地址找不到
设置发件人的信息
vim /etc/mail.rc
添加:
set from=busername@sina.com
set smtp=smtp.sina.com
set smtp-auth-user=username
set smtp-auth-password=passwd
set smtp-auth=login
重启sendmail
systemctl restart sendmail
263的SMTP是:
smtp.263.net
网友评论