So, a friend of mine needed to test an email (SMTP) mail server and was writing something to do this in java when I mentioned that it could be tested via telnet.
Here are some of the commands that I’ve used previously:
- Telnet to the mail server on the correct port (by default port 25) e.g.
telnet mailhost 25 - Type EHLO <domain name> and press enter e.g.
EHLO test.com - Type MAIL FROM:<valid sending email address> e.g.
MAIL FROM:tester1@test.com - Type RCPT TO:<valid receiving mailbox to which you have access> e.g.
RCPT TO:tester2@test.com - Type DATA and press enter
- (Optional) Type Subject: <subject of the test email> e.g.
Subject:This is a test email via telnet to port 25 on mailhost - Press Enter to leave a blank line
- Enter the text of the message e.g.
This is a test message sent at 10:33 on 12/08/2009 - Press Enter, then a full-stop/period, then Enter again to end the message
- Type QUIT to disconnect from the mail server
- Exit Telnet as normal.
I’ve put the commands in the text in bold so that they’re easier to spot, but if you follow the examples, you should be fine.
Leave a Reply