白天和黑夜只交替没交换无法想像对方的世界
分类: 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