您的位置:首页 > 运维架构 > Shell

linux shell发送带附件的邮件

2015-09-25 10:55 399 查看
转自:http://www.cnblogs.com/pony/archive/2007/12/19/1006050.html

如果没有正文文件的话,就用echo直接把正文打出来就行了,如:

echo "this is content" | mutt -s "this is subject" -a /path/yourfile abc@local.domain -c bbb@local.domain

如果有正文文件的话就用

cat /path/contentfile | mutt -s "this is subject" -a /path/yourfile abc@local.domain -c bbb@local.domain

mutt是linux下一个强大的邮件客户端软件.

-s是主题

-a是附件

-c是抄送,多个抄送就是多个-c,如

cat /path/contentfile | mutt -s "this is subject" -a /path/yourfile abc@local.domain -c bbb@local.domain -c ccc@local.domain -cddd@local.domain

如果发送多个email,就直接列出来就行了,如

cat /path/contentfile | mutt -s "this is subject" -a /path/yourfile abc@local.domain bbb@local.domain ccc@local.domainddd@local.domain
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: