高级搜索 返回首页  
名人名言
哲理小故事
技术文章
    - LINUX文章
山阴客技术文章LINUX文章linux上使用 sendmail 发送 html格式内容的 邮件
linux上使用 sendmail 发送 html格式内容的 邮件
2023-01-11 11:07:43
by 山阴客  
Rating: not rated yet
1 2 3 4 5 6 7 8 9 10

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

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

 

(
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

推荐给好友 打包下载这篇文章 打印这篇文章

Copyright © 2002 myarticle.com.cn
All rights reserved.

备案号:浙ICP备17002154号-3 Powered by: MyArticle Version 1.0dev
Processed Time: 0.0026 s Querys: 5 [ Gzip Level 0 ]