【问题标题】:Can't send html email using exim无法使用 exim 发送 html 电子邮件
【发布时间】:2015-09-13 02:03:30
【问题描述】:

我正在尝试使用 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。

【问题讨论】:

    标签: linux email console mime exim


    【解决方案1】:

    我找到了解决方法。我安装了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
    

    邮件正文是与您的邮件一起归档的文件。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-08-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-11
      • 1970-01-01
      • 2017-06-07
      相关资源
      最近更新 更多