首先,Linux 上配置安装mailx 或 postfix 软件。
然后使用 mailx 或 sendmail 发邮件。

linux上使用 sendmail 发送 html格式内容的 邮件

(
echo "To: lipeng20004@126.com"
echo "Subject: The Subject"
echo "Content-Type: text/html"
echo
cat ./part.html
) | sendmail -t

linux上 mailx 发邮件测试

mailx -s "$(echo -e "subject\nContent-Type: text/html; charset=utf-8")" lipeng20004@126.com < part.html
mailx -s "$(echo -e "subject\nContent-Type: text/html; Charset=GB2312")" lipeng20004@126.com < part.html
echo "ttt" | mailx -s "email title: test mail" lipeng20004@126.com

相关文章:

  • 2022-02-05
  • 2021-05-26
  • 2021-06-18
  • 2021-04-04
  • 2021-07-29
  • 2022-12-23
  • 2022-12-23
  • 2021-07-05
猜你喜欢
  • 2022-12-23
  • 2021-08-31
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
相关资源
相似解决方案