1. 启动sendmail 的进程
sudo /etc/init.d/sendmail start
ps aux|grep sendmail2. 组装html的文件
Subject: title-testing
From: zengtai.csm@xxx.com
To: zengtai.csm@xxx.com
Cc: zengtai.csm@xxx.com
MIME-VERSION: 1.0
Content-Type: multipart/mixed; boundary="GvXjxJ+pjyke8COw"
--GvXjxJ+pjyke8COw
Content-type: text/html; charset=gb2312 #设置编码后中文还是乱码
Content-Transfer-Encoding: 7bit
<html>
<body>
<table border="0" cellpadding="0" cellspacing="1" bgcolor="black">
<tr>
<th bgcolor="#66ffff">data table name</th>
<th bgcolor="#66ffff">data table size</th>
<th bgcolor="#66ffff">data table time</th>
</tr>
<tr>
<th bgcolor="white">data_index</th>
<th bgcolor="white">2048M</th>
<th bgcolor="white">20150806</th>
</tr>
</table>
</body>
</html>3. sendmail 发送命令
cat t.txt|sendmail -t -F zengtai.csm@xxx.com4. python 用smtplib 发送邮件, smtp_server"127.0.0.1"
netstat -lan|grep 25
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN5. sendmail 的smtp的服务配置文件
rpm -qf /etc/init.d/sendmail
sendmail-8.13.8-8.1.rpm
/etc/mail/sendmail.mc
1042




被折叠的 条评论
为什么被折叠?



