ITPub博客

首页 > Linux操作系统 > Linux操作系统 > linux下发送带附件EMAIL

linux下发送带附件EMAIL

Linux操作系统 作者:xiaowurq 时间:2016-02-14 11:04:33 0 删除 编辑

当oracle出问题的时候,想发送附件到指定的邮箱,本来想用mail来发送,可是它需要安装uuencode才能发附件,uuencode这个程序linux默认没有安装,后面发现用mutt来发送,发现非常方便,功能非常强大

1:mutt方法

echo hello mutt ,i love you|mutt -s "my subjects" -a install.log logjiang@boobooke.com

上述中hello mutt ,i love you是邮件的内容

my subjects是邮件的主题

install.log 是附件名称

logjiang@boobooke.com是自己架的邮件服务器地址

以下为help内容


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

2:uuencode方法

uuencode 本地文件名 附件名 | mail -s 主题 logjiang@boobooke.com

[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27299877/viewspace-1988412/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2014-12-10

  • 博文量
    6
  • 访问量
    26863