我试图用mailx实用程序(Heirloommailx12.4)发送内联html (但没有效果)。电子邮件是以纯文本发送的。
。
编辑:几个小时后,我找到了这个帖子,它让我走得更远了。电子邮件现在用HTML发送,但在文本中包含标题。脚本如下:
mailx -v -S smtp=SERVER -s "$(echo -e "This is the subject v1\nContent-Type: text/html\nMIME-Version: 1.0\nContent-Disposition: inline")" -r FROM TO < htmlmail.txt来源:https://unix.stackexchange.com/questions/384536/html-email-from-heirloom-mailx-on-linux

发布于 2022-06-08 21:40:26
这一切都是关于后缀的正确设置:
sudo nano /etc/postfix/main.cf添加以下内容:
smtp_mime_header_checks = pcre:/etc/postfix/smtp_mime_header_checks.pcresudo nano /etc/postfix/smtp_mime_header_checks.pcre添加以下内容:
/^Content-Type:/ REPLACE Content-Type: text/html; charset="UTF-8"
/^Content-Transfer-Encoding:/ REPLACE Content-Transfer-Encoding: quoted-printablesudo nano restart postfixhttps://stackoverflow.com/questions/59490875
复制相似问题