命令行及脚本发送邮件测试的方法:
方法一:
[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:<[email protected]>
250 2.1.0 <[email protected]>... Sender ok
data
354 Enter mail, end with "." on a line by itself
----------------------------------
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 <<EOF
From: Mail testing <[email protected]>
subject:mail testing
EOF
本文转自vcdog 51CTO博客,原文链接:http://blog.51cto.com/255361/836915,如需转载请自行联系原作者