测试smtp 邮件服务器

Developers in my office constantly complain that the SMTP server is down and no mails are being sent out. We come back saying that their application is buggy. Most often after hours of troubleshooting the problem will turn out to be the application itself.

Here’s a simple way to test your SMTP server over port 25 using Telnet to proof them wrong.

Telnet to the server via port 25.

1. Key in “EHLO example.com” and hit enter.

2. Key in “MAIL FROM: [email protected]” and hit enter.

3. Key in “RCPT TO: [email protected]” and hit enter.

4. Key in “DATA” and hit enter.

5. Key in your message body and hit enter.

6. Key in ” . ” and press enter.

If you received the mail then your SMTP is working fine.

Sample output,

[root@abooboo tmp]# telnet 192.168.0.25 25
Trying 192.168.0.25...
Connected to 192.168.0.25 (192.168.0.25).
Escape character is '^]'.
220 smtp11.klk.example.com Microsoft ESMTP MAIL Service, Version: 5.0.2195.6713 ready at  Thu, 3 Apr 2008 15:39:17 +0800
helo Vsource.com

250 smtp.example.com

MAIL FROM: [email protected]

250 2.1.0 [email protected] OK
RCPT TO: [email protected]
250 2.1.5 [email protected]
DATA
354 Start mail input; end with .
this is a test over SMTP
.
250 2.6.0  Queued mail for delivery
quit
221 2.0.0 smtp11.klk.example.com Service closing transmission channel
Connection closed by foreign host.
[root@abooboo tmp]#

较细文献:http://linux.chinaunix.net/techdoc/net/2007/06/16/960344.shtml

你可能感兴趣的:(smtp)