[英]Can't send html email using exim
我正在尝试使用smarthost通过以下命令发送html邮件:
cat test_mail.txt | mail -a "MIME-Version: 1.0" -a "Content-Type: text/html" -s "title" example@mail.com
我也尝试过使用这个:
mail -a "Content-type: text/html;" -s 'title' example@mail.com < test_mail.txt
但这是不可能的,因为我收到此错误:
MIME-Version: 1.0: No such file or directory
我正在使用exim:
dpkg -S `which sendmail`
exim4-daemon-light: /usr/sbin/sendmail
我的系统是Ubuntu 14.04.2 LTS。
我找到了解决方法。 我安装了postfix,因此邮件配置如下:
dpkg -S `which sendmail`
postfix: /usr/sbin/sendmail
然后,您可以使用以下命令发送电子邮件:
cat mailheader mailbody | sendmail -t
其中mailheader是包含以下内容的文件:
To: mail@example.com
Subject: Example Subject
Content-Type: text/html; charset=UTF-8
并将其与您的邮件一起归档。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.