- A+
所属分类:Linux
sendEmail是一个轻量级,命令行的SMTP邮件客户端。如果你需要使用命令行发送邮件,那么sendEmail是非常完美的选择:使用简单并且功能强大.这个被设计用在php、bash
perl和web站点使用。
以上是sendEmail的简单介绍,千万不要和sendmail搞混掉了。用了sendEmail你将不在喜欢sendmail了.
下载安装sendEmail
1 2 3 4 |
sendEmail下载地址:http://caspian.dotconf.net/menu/Software/SendEmail/ # wget http://caspian.dotconf.net/menu/Software/SendEmail/sendEmail-v1.56.tar.gz //下载1.56版本 # tar -xzvf sendEmail-v1.56.tar.gz //解压后就可以使用了 # mv sendEmail /usr/local/bin/ |
发送邮件
1 2 3 |
# /usr/local/bin/sendEmail -f ttlsafrom@163.com -t ttlsato@qq.com \ -s smtp.163.com -u "我是邮件主题" -o message-content-type=html \ -o message-charset=utf8 -xu ttlsafrom@163.com -xp 123456 -m "我是邮件内容" |
命令说明:
1 2 3 4 5 6 7 8 9 |
/usr/local/bin/sendEmail 命令主程序 -f ttlsafrom@163.com 发件人邮箱 -s smtp.163.com 发件人邮箱的smtp服务器 -u "我是邮件主题" 邮件的标题 -o message-content-type=html 邮件内容的格式,html表示它是html格式 -o message-charset=utf8 邮件内容编码 -xu ttlsafrom@163.com 发件人邮箱的用户名 -xp 123456 发件人邮箱密码 -m "我是邮件内容" 邮件的具体内容 |
发送成功之后会有如下提示:
Jul 29 15:02:53 e10074 sendEmail[26347]: Email was sent successfully!
sendEmail使用命令帮助
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
[root@li229-122 scripts]# sendEmail --help sendEmail-1.56 by Brandon Zehm <caspian@dotconf.net> Synopsis: sendEmail -f ADDRESS [options] Required: -f ADDRESS from (sender) email address * At least one recipient required via -t, -cc, or -bcc * Message body required via -m, STDIN, or -o message-file=FILE Common: -t ADDRESS [ADDR ...] to email address(es) -u SUBJECT message subject -m MESSAGE message body -s SERVER[:PORT] smtp mail relay, default is localhost:25 Optional: -a FILE [FILE ...] file attachment(s) -cc ADDRESS [ADDR ...] cc email address(es) -bcc ADDRESS [ADDR ...] bcc email address(es) -xu USERNAME username for SMTP authentication -xp PASSWORD password for SMTP authentication Paranormal: -b BINDADDR[:PORT] local host bind address -l LOGFILE log to the specified file -v verbosity, use multiple times for greater effect -q be quiet (i.e. no STDOUT output) -o NAME=VALUE advanced options, for details try: --help misc -o message-content-type=<auto|text|html> -o message-file=FILE -o message-format=raw -o message-header=HEADER -o message-charset=CHARSET -o reply-to=ADDRESS -o timeout=SECONDS -o username=USERNAME -o password=PASSWORD -o tls=<auto|yes|no> -o fqdn=FQDN Help: --help the helpful overview you're reading now --help addressing explain addressing and related options --help message explain message body input and related options --help networking explain -s, -b, etc --help output explain logging and other output options --help misc explain -o options, TLS, SMTP auth, and more |
sendEmail发送邮件内容到此结束,如有什么不明白的,请留言.

微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
15/01/2018 下午 5:17 沙发
foxmail客户端上显示的是 伦敦时间 2018年1月15日, 星期一 (周一) 08:39,设置什么参数可以变成北京时间?
15/01/2018 下午 5:13 板凳
/usr/local/bin/sendEmail -f ttlsafrom@163.com -t ttlsato@qq.com \
-s smtp.163.com -u “我是邮件主题” -o message-content-type=html \
-o message-charset=utf8 -xu ttlsafrom@163.com -xp 123456 -m “我是邮件内容”
字符集应该是utf-8
08/01/2018 下午 1:59 地板
Jan 08 00:56:09 rent-alva-141 sendEmail[14450]: DEBUG => Connecting tosmtp.ourpalm.com:465
Jan 08 00:56:10 rent-alva-141 sendEmail[14450]: DEBUG => My IP address is: 172.18.55.174
Jan 08 00:57:10 rent-alva-141 sendEmail[14450]: ERROR => Timeout while reading from smtp.ourpalm.com:465 There was no response after 60 seconds.
求教如何使用ssl协议发邮件,总是超时,465端口是通的。
10/11/2017 下午 5:24 4楼
楼主你好,我想请教个一个问题,我在使用sendEmail命令发送邮件的时候总是不成功,提示错误“sendEmail[24754]: ERROR => Timeout while connecting to smtp.126.com:25 There was no response after 60 seconds.”,如果使用465端口,则提示“sendEmail[24789]: ERROR => smtp.126.com:465 returned a zero byte response to our query.”
25/05/2017 下午 5:39 5楼
May 25 19:40:47 localhost sendEmail[3505]: ERROR => Received: 421 closing transmission channel
这个报错是什么原因 搞了半天没搞明白
25/05/2017 下午 5:37 6楼
May 25 19:40:47 localhost sendEmail[3505]: ERROR => Received: 421 closing transmission channel
报这个错 是怎么回事 搞半天
16/03/2017 上午 10:38 7楼
请问如何把文本文件作为邮件内容发送?我试了cat和管道符,实现不了
13/01/2017 下午 12:02 8楼
501 mail from address must be same as authorization user这个是什么情况
26/10/2016 下午 4:06 9楼
为啥我解压那个包后提示都没有sendEmail 这个命令啊?
01/11/2016 下午 4:19 1层
@匿名 你确定?
19/10/2016 下午 5:19 10楼
您好呀,请问这个发送邮件的记录的log在哪里呀,找不到,我目前用的它发送,对于级别的高的发到手机号上,但是很多时候用它没受到报警邮件,只收到恢复邮件
26/09/2016 下午 3:17 11楼
在使用的时候报错,invalid SSL_version specified,通过增加-o tls=no参数解决。
11/09/2016 下午 2:04 12楼
SMTP-AUTH: Authentication to smtp.163.com:25 failed. 求解答,163邮箱已设置smtp开启,还是失败,有没有搞定的 指导一下
11/03/2016 下午 2:10 13楼
Mar 11 14:09:27 cctvsh017 sendEmail[661]: Message input complete.
Mar 11 14:09:27 cctvsh017 sendEmail[661]: ERROR => Received: 421 4.3.2 Service not available, closing transmission channel
这个错误怎么解决
01/12/2015 下午 7:46 14楼
您好,博主,我下载一个sendemail,减压后发邮件报如下错误:Unrecognized character x7F in column 1 at /usr/share/perl5/strict.pm line 1.
Compilation failed in require at ./sendEmail line 38.
BEGIN failed–compilation aborted at ./sendEmail line 38.
这个是什么依赖的文件有问题导致编译失败还是什么原因,谢谢了。
01/12/2015 下午 7:47 1层
@游客123 我的邮箱42445285@qq.com 谢谢博主
01/12/2015 下午 8:51 1层
@游客123 http://www.ttlsa.com/linux/curl-skill-use-curl-send-email/ 试试curl发送邮件
07/09/2015 上午 11:27 15楼
直接复制代码显示SMTP-AUTH: Authentication to smtp.163.com:25 failed. 自己申请了一个163邮箱后开启smtp结果还是显示这个是什么原因呢?
07/09/2015 下午 1:11 1层
@文台 可否将账号密码发送至support@ttlsa.com,便于拍错
04/09/2015 下午 11:54 16楼
ERROR => SMTP-AUTH: Authentication to smtp.163.com:25 failed 这个问题解决了吗,我也碰到了,没找到原因
07/06/2016 下午 3:17 1层
@运维生存时间网友 邮箱密码用授权码
21/08/2015 上午 9:19 17楼
邮件标题中文乱码 怎么解决,谢谢!!!
06/09/2015 上午 9:58 1层
@Springlin -o message-charset=CHARSET 指定字符集
19/06/2015 下午 3:12 18楼
localhost sendEmail[25498]: EXITING: Received SIGINT 这个是什么问题 啊
17/06/2015 下午 2:54 19楼
ERROR => ERROR => SMTP-AUTH: Authentication to smtp.163.com:25 failed. 这个提示是为什么啊?谢谢。
17/06/2015 下午 3:50 1层
@暧昧3么么 验证失败。 1. 确认密码是否错误 2. 要开启163的smtp功能(默认关闭的),进入163邮箱设置里面。 一般是2的问题。
04/09/2015 下午 11:54 1层
@暧昧3么么 ERROR => SMTP-AUTH: Authentication to smtp.163.com:25 failed 这个问题解决了吗,我也碰到了,没找到原因
06/09/2015 上午 9:58 2层
@匿名 验证失败。 1. 确认密码是否错误 2. 要开启163的smtp功能(默认关闭的),进入163邮箱设置里面。 一般是2的问题。
04/06/2015 下午 1:53 20楼
sendEmail可以使用ssl 的465端口发邮件么?怎么实现的?
17/06/2015 下午 3:50 1层
@阿飞 与sendEmail没关系,和邮件服务器有关
来自外部的引用: 4