白天和黑夜只交替没交换无法想像对方的世界
分类: Python/Ruby
2011-08-19 23:46:52
命令行及脚本发送邮件测试的方法:
方法一:
[root@dg01 ~]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.localdomain (127.0.0.1).
Escape character is '^]'.
220 dg01.com.cn ESMTP Sendmail 8.13.8/8.13.8; Fri, 19 Aug 2011 06:53:38 -0400
helo demo.domain.tld
250 dg01.com.cn Hello localhost.localdomain [127.0.0.1], pleased to meet you
mail from:
rcpt to:<>
250 2.1.5 <>... Recipient ok
data
354 Enter mail, end with "." on a line by itself
----------------------------------
This is the mail test content
----------------------------------
----------------------------------
This is the mail test content
----------------------------------
.
250 2.0.0 p7JArcEE018377 Message accepted for delivery
quit
方法二:
脚本测试
[root@dg01 ~]# cat mtest.sh
#!/bin/bash
/usr/sbin/sendmail -t <
TO:kevin@126.com
Cc:root@dg01.com.cn
Bcc:kevin@hotmail.com
subject:mail testing
----------------------------------
This is the mail test content
----------------------------------
----------------------------------
This is the mail test content
----------------------------------
EOF