Linux Can';t使用exim发送html电子邮件

Linux Can';t使用exim发送html电子邮件,linux,email,console,mime,exim,Linux,Email,Console,Mime,Exim,我正在尝试使用smarthost通过以下命令发送html邮件: cat test_mail.txt | mail -a "MIME-Version: 1.0" -a "Content-Type: text/html" -s "title" example@mail.com cat mailheader mailbody | sendmail -t 我也尝试过使用这个: mail -a "Content-type: text/html;" -s 'title' example@mail.co

我正在尝试使用smarthost通过以下命令发送html邮件:

cat test_mail.txt | mail -a "MIME-Version: 1.0" -a "Content-Type: text/html" -s "title" example@mail.com
cat mailheader mailbody | sendmail -t
我也尝试过使用这个:

mail  -a "Content-type: text/html;" -s 'title' example@mail.com  < test_mail.txt
我正在使用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 test_mail.txt | mail -a "MIME-Version: 1.0" -a "Content-Type: text/html" -s "title" example@mail.com
cat mailheader mailbody | sendmail -t
其中mailheader是包含以下内容的文件:

To: mail@example.com
Subject: Example Subject
Content-Type: text/html; charset=UTF-8

邮件正文是包含您的邮件的文件。

我找到了解决方法。我安装了postfix,所以邮件配置如下:

dpkg -S `which sendmail`
postfix: /usr/sbin/sendmail
然后,您可以使用以下命令发送电子邮件:

cat test_mail.txt | mail -a "MIME-Version: 1.0" -a "Content-Type: text/html" -s "title" example@mail.com
cat mailheader mailbody | sendmail -t
其中mailheader是包含以下内容的文件:

To: mail@example.com
Subject: Example Subject
Content-Type: text/html; charset=UTF-8
邮件正文是包含您的邮件的文件