sendEmail是一个轻量级,命令行的SMTP邮件客户端。如果你需要使用命令行发送邮件,那么sendEmail是非常完美的选择:使用简单并且功能强大.这个被设计用在php、bash
perl和web站点使用。
以上是sendEmail的简单介绍,千万不要和sendmail搞混掉了。用了sendEmail你将不在喜欢sendmail了.
下载安装sendEmail
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/
发送邮件
# /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 "我是邮件内容"
命令说明:文章源自运维生存时间-https://www.ttlsa.com/linux/use-sendemail/
/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!文章源自运维生存时间-https://www.ttlsa.com/linux/use-sendemail/
sendEmail使用命令帮助
[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发送邮件内容到此结束,如有什么不明白的,请留言.文章源自运维生存时间-https://www.ttlsa.com/linux/use-sendemail/
文章源自运维生存时间-https://www.ttlsa.com/linux/use-sendemail/文章源自运维生存时间-https://www.ttlsa.com/linux/use-sendemail/
我的微信
微信公众号
扫一扫关注运维生存时间公众号,获取最新技术文章~
21F
foxmail客户端上显示的是 伦敦时间 2018年1月15日, 星期一 (周一) 08:39,设置什么参数可以变成北京时间?
20F
/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
19F
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端口是通的。
18F
楼主你好,我想请教个一个问题,我在使用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.”
17F
May 25 19:40:47 localhost sendEmail[3505]: ERROR => Received: 421 closing transmission channel
这个报错是什么原因 搞了半天没搞明白
16F
May 25 19:40:47 localhost sendEmail[3505]: ERROR => Received: 421 closing transmission channel
报这个错 是怎么回事 搞半天
15F
请问如何把文本文件作为邮件内容发送?我试了cat和管道符,实现不了
14F
501 mail from address must be same as authorization user这个是什么情况
13F
为啥我解压那个包后提示都没有sendEmail 这个命令啊?
B1
@ 匿名 你确定?
12F
您好呀,请问这个发送邮件的记录的log在哪里呀,找不到,我目前用的它发送,对于级别的高的发到手机号上,但是很多时候用它没受到报警邮件,只收到恢复邮件
11F
在使用的时候报错,invalid SSL_version specified,通过增加-o tls=no参数解决。
10F
SMTP-AUTH: Authentication to smtp.163.com:25 failed. 求解答,163邮箱已设置smtp开启,还是失败,有没有搞定的 指导一下
9F
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
这个错误怎么解决
8F
您好,博主,我下载一个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.
这个是什么依赖的文件有问题导致编译失败还是什么原因,谢谢了。
B1
@ 游客123 我的邮箱42445285@qq.com 谢谢博主
B1
@ 游客123 http://www.ttlsa.com/linux/curl-skill-use-curl-send-email/ 试试curl发送邮件
7F
直接复制代码显示SMTP-AUTH: Authentication to smtp.163.com:25 failed. 自己申请了一个163邮箱后开启smtp结果还是显示这个是什么原因呢?
B1
@ 文台 可否将账号密码发送至support@ttlsa.com,便于拍错
6F
ERROR => SMTP-AUTH: Authentication to smtp.163.com:25 failed 这个问题解决了吗,我也碰到了,没找到原因
B1
@ 运维生存时间网友 邮箱密码用授权码
5F
邮件标题中文乱码 怎么解决,谢谢!!!
B1
@ Springlin -o message-charset=CHARSET 指定字符集
4F
localhost sendEmail[25498]: EXITING: Received SIGINT 这个是什么问题 啊
3F
ERROR => ERROR => SMTP-AUTH: Authentication to smtp.163.com:25 failed. 这个提示是为什么啊?谢谢。
B1
@ 暧昧3么么 验证失败。 1. 确认密码是否错误 2. 要开启163的smtp功能(默认关闭的),进入163邮箱设置里面。 一般是2的问题。
B1
@ 暧昧3么么 ERROR => SMTP-AUTH: Authentication to smtp.163.com:25 failed 这个问题解决了吗,我也碰到了,没找到原因
B2
@ 匿名 验证失败。 1. 确认密码是否错误 2. 要开启163的smtp功能(默认关闭的),进入163邮箱设置里面。 一般是2的问题。
2F
sendEmail可以使用ssl 的465端口发邮件么?怎么实现的?
B1
@ 阿飞 与sendEmail没关系,和邮件服务器有关
来自外部的引用