免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 8905 | 回复: 11
打印 上一主题 下一主题

请教shell实现html邮件的发送 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-09-05 16:06 |只看该作者 |倒序浏览
经常用shell来发送系统检查的邮件
只会cat file |mail -----------
这样的方式,在收到邮件后,通常都是一个很普通的形式.
有看到收件格式是html格式的,显得非常漂亮,而且一目了然,但不晓得怎么实现,各位高人是否知晓,敬请告知!!!

论坛徽章:
7
荣誉版主
日期:2011-11-23 16:44:17子鼠
日期:2014-07-24 15:38:07狮子座
日期:2014-07-24 11:00:54巨蟹座
日期:2014-07-21 19:03:10双子座
日期:2014-05-22 12:00:09卯兔
日期:2014-05-08 19:43:17卯兔
日期:2014-08-22 13:39:09
2 [报告]
发表于 2006-09-05 16:13 |只看该作者

HTMLizer or txt2html

论坛徽章:
0
3 [报告]
发表于 2006-09-05 16:32 |只看该作者
有linux或unix下的转换工具吗
问另一个问题,mail命令怎么发带附件的邮件

[ 本帖最后由 小渔儿 于 2006-9-5 16:37 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2006-09-05 16:37 |只看该作者

回复 3楼 小渔儿 的帖子

mail命令好象没有带附件的,有另外的工具来实现的.

论坛徽章:
0
5 [报告]
发表于 2006-09-05 17:25 |只看该作者

  1. echo "<h1>你好</h1><p style=\"color:red; background-color:gray; height:10em;\">html 邮件测试</p>" | email --html --smtp-user 发送邮件所用的帐号 --smtp-pass 发送邮件所用的密码 --subject "这里是标题" --attach 文件1.zip,文件2.jpg,文件3.tar --cc 抄送到邮件地址 -bcc 暗送到邮件地址 收件人邮件地址
复制代码

[ 本帖最后由 lovetide 于 2006-9-5 17:31 编辑 ]

论坛徽章:
0
6 [报告]
发表于 2006-09-05 17:37 |只看该作者

论坛徽章:
1
荣誉会员
日期:2011-11-23 16:44:17
7 [报告]
发表于 2006-09-05 17:42 |只看该作者
原帖由 小渔儿 于 2006-9-5 16:32 发表
有linux或unix下的转换工具吗
问另一个问题,mail命令怎么发带附件的邮件

http://bbs.chinaunix.net/viewthr ... p;page=1#pid3647964

论坛徽章:
0
8 [报告]
发表于 2006-09-05 20:57 |只看该作者
原帖由 lovetide 于 2006-9-5 17:25 发表
[code]
echo "<h1>你好</h1><p style=\"color:red; background-color:gray; height:10em;\">html 邮件测试</p>" | email --html --smtp-user 发送邮件所用的帐号 - ...


email 这个命令好像没有在我的linux里,是另外装的吗

论坛徽章:
0
9 [报告]
发表于 2006-09-06 09:07 |只看该作者
呵呵,我是在 Windows 下的 cygwin 仿 unix 环境下用 email 的,cygwin 自身带这个工具,我没用过真实的 linux,不知道有没有

email 工具的主页
http://email.cleancode.org/


  1. $ email --version
  2. email - By: Dean Jones. Email: dj@cleancode.org.
  3. Version 2.5.0 - Date 06/16/2006-10:13:00AM_EDT
复制代码

[ 本帖最后由 lovetide 于 2006-9-6 09:16 编辑 ]

论坛徽章:
0
10 [报告]
发表于 2006-09-06 14:25 |只看该作者
用mutt

#mutt -h
Mutt 1.4.2.1i (2004-02-12)
usage: mutt [ -nRyzZ ] [ -e <cmd> ] [ -F <file> ] [ -m <type> ] [ -f <file> ]
       mutt [ -nx ] [ -e <cmd> ] [ -a <file> ] [ -F <file> ] [ -H <file> ] [ -i <file> ] [ -s <subj> ] [ -b <addr> ] [ -c <addr> ] <addr> [ ... ]
       mutt [ -n ] [ -e <cmd> ] [ -F <file> ] -p
       mutt -v[v]

options:
  -a <file>     attach a file to the message
  -b <address>  specify a blind carbon-copy (BCC) address
  -c <address>  specify a carbon-copy (CC) address
  -e <command>  specify a command to be executed after initialization
  -f <file>     specify which mailbox to read
  -F <file>     specify an alternate muttrc file
  -H <file>     specify a draft file to read header from
  -i <file>     specify a file which Mutt should include in the reply
  -m <type>     specify a default mailbox type
  -n            causes Mutt not to read the system Muttrc
  -p            recall a postponed message
  -R            open mailbox in read-only mode
  -s <subj>     specify a subject (must be in quotes if it has spaces)
  -v            show version and compile-time definitions
  -x            simulate the mailx send mode
  -y            select a mailbox specified in your `mailboxes' list
  -z            exit immediately if there are no messages in the mailbox
  -Z            open the first folder with new message, exit immediately if none  -h            this help message
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP