[shell]在终端下发送html格式的邮件

Gmail,Outlook都是支持html格式的邮件的,比plain txt内容更丰富。但是console下怎么发html格式的邮件呢?mail?mutt?我google了好几篇文章,都没搞定(用mutt加header发送是没用的),最后,一位仁兄给出答案:
http://www.liamdelahunty.com/tips/linux_send_html_email_from_command_line.php

很简单,在html文件(比如my.html)前面补上三行:
To: hao.bigrat@example.com
Subject: OhMyGod
Content-Type: text/html; charset="gbk"

<html>
<table>
......

然后
sendmail hao.bigrat@example.com < my.html

相关文章

分类

2 Comments

liubin said:

cat my.html | mutt -s 'OhMyGod' -e 'set content_type="text/html"' hao.bigrat@example.com

DongHao Author Profile Page said:

Nice example! Thanks

留言:

关于文章

This page contains a single entry by DongHao published on 01 8, 2010 2:01 PM.

契约 was the previous entry in this blog.

“我能见一下为我做这份晚餐的厨师吗?” is the next entry in this blog.

Find recent content on the main index or look in the 存档 to find all content.