+ -
当前位置:首页 → 问答吧 → mutt怎么发生html格式的邮件?

mutt怎么发生html格式的邮件?

时间:2011-06-03

来源:互联网

我想发送html格式的邮件内容,但是发送后邮件内容是html的源码,加了一行 -e "my_hdr Content-Type: text/html" 还是不行,
请问各位朋友怎么写或是怎么修改配置文件能发送html格式邮件呢?谢谢。着急!

作者: linux68   发布时间: 2011-06-03

回复 linux68


    非要用mutt吗,用sendmail吧


在html文件开头加三行:
To: [email protected]
Subject: hello world
Content-Type: text/html; charset="gbk"
<html>
<table>
......

然后
sendmail [email protected] <ur.html

作者: shplpy   发布时间: 2011-06-03

用sendmail能发但是显示中午都是乱码,邮件内容可以正常显示,但是标题就都是乱码,不知道怎么解决了就换了一种方法,呵呵,你知道怎么解决标题乱码的问题吗?
我是这样写的:
/usr/sbin/sendmail -t <<EOF
From: NBD STAT <[email protected]>
To: [email protected]
Cc:[email protected]
Content-Type:text/html
Subject: 各平台分版本日志数据两小时监控()
$html(邮件内容)
EOF

作者: linux68   发布时间: 2011-06-03

回复 linux68


    加这个Content-Type: text/html; charset="gbk"也乱码吗

作者: shplpy   发布时间: 2011-06-03

回复 linux68


    或者在sendmail加个参数-o message-header=GB2312

作者: shplpy   发布时间: 2011-06-03

mutt -e "set content_type=text/html" -s "subject" [email protected] < xxxx.html

作者: xiaopan3322   发布时间: 2011-06-03

对,加了这个Content-Type: text/html; charset="gbk"还是乱码,我把gbk换成utf8也是乱码。

作者: linux68   发布时间: 2011-06-03

回复 xiaopan3322
不行,那样收到的邮件内容是html源码。

作者: linux68   发布时间: 2011-06-03