centos6.5安装sendmail

1.下载安装sendEmail(下载绿色版,解压可直接使用)

wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz 
tar -xzvf sendEmail-v1.56.tar.gz
mv sendEmail-v1.56 /usr/local/
sendemail
ln -s /usr/local/sendemail/sendEmail /usr/sbin/sendmail

2.发送邮件

sendmail -f xpeka@163.com -t 3956865697@qq.com -s smtp.163.com -u "邮件主题" -o message-content-type=html -o message-charset=utf8 -xu xpeka -xp xxxx -m "邮件内容"

命令说明:

sendmail:邮件主程序
-f [email protected]:发件人邮箱
-t [email protected]:收件人邮箱
-s smtp.163.com:发件人的smtp服务器地址
-u "邮件主题":邮件的标题
-o message-content-type=html:邮件内容的格式,html表示它是html格式
-o message-charset=utf8:邮件内容编码
-xu x.peka:发件人的邮箱账号
-xp xxxx:发件人邮箱密码
-m "邮件内容":邮件的具体内容

发送成功之后会有如下提示:

[root@localhost myshell]# sendmail -f xpeka@163.com -t [email protected] -s smtp.163.com -u lwj -o message-content-type=html -o message-charset=utf8 -xu xpeka -xp xxxx -m lzy 

Feb
02 17:17:30 localhost sendmail[6652]: Email was sent successfully!

 

你可能感兴趣的:(centos6.5安装sendmail)