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:

  1. Telnet to the mail server on the correct port (by default port 25) e.g. telnet mailhost 25
  2. Type EHLO <domain name> and press enter e.g. EHLO test.com
  3. Type MAIL FROM:<valid sending email address> e.g. MAIL FROM:tester1@test.com
  4. Type RCPT TO:<valid receiving mailbox to which you have access> e.g. RCPT TO:tester2@test.com
  5. Type DATA and press enter
  6. (Optional) Type Subject: <subject of the test email> e.g. Subject:This is a test email via telnet to port 25 on mailhost
  7. Press Enter to leave a blank line
  8. Enter the text of the message e.g. This is a test message sent at 10:33 on 12/08/2009
  9. Press Enter, then a full-stop/period, then Enter again to end the message
  10. Type QUIT to disconnect from the mail server
  11. 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.

Tags: , , , , , ,

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>