You are on page 1of 2

Test Email flow using SMTP commands - Spiceworks Community

http://community.spiceworks.com/how_to/show/11

Welcome to the Spiceworks Community


The community is home to over 1.5 million IT Pros in small-to-medium businesses. Are you an IT Pro? Creating your account only takes a few minutes.

Community

How-tos

Test Email flow using SMTP commands


by Martin9700

Often you need to test email and if it's working. With these commands you can test email flow at a very granular level to determine what's broken and where. Scenario: Your domain: mydomain.com Domain you wish to send to: theirdomain.com Determine the mail server you're sending to. * Open a CMD prompt * Type NSLOOKUP > set q=mx 1.> theirdomain.com Response: Non-authoritative answer: theirdomain.com MX preference = 50, mail exchanger = mail.theirdomain.com Connect to their mail server SMTP communicates over port 25. We will now try to use TELNET to connect to their mail server "mail.theirdomain.com" * Open a CMD prompt * TELNET MAIL.THEIRDOMAIN.COM 25 You should see something like this as a response: 2.220 mx.google.com ESMTP 6si6253627yxg.6 Be aware that different servers will come up with different greetings but you should get SOMETHING. If nothing comes up at this point there are 2 possible problems. Port 25 is being blocked at your firewall, or their server is not responding. Try a different domain, if that works then it's not you. Send an Email Now, use simple SMTP commands to send a test email. This is very important, you CANNOT use the backspace key, it will work onscreen but not be interpreted correctly. You have to type these commands perfectly. ehlo mydomain.com mail from:<martin9700@mydomain.com> rcpt to:<recipient@theirdomain.com> data This is a test, please do not respond . quit 3.So, what does that all mean? EHLO - introduce yourself to the mail server HELO can also be used but EHLO tells the server to use the extended command set (not that we're using that). MAIL FROM - who's sending the email. Make sure to place this is the greater than/less than brackets as many email servers will require this (Postini). RCPT TO - who you're sending it to. Again you need to use the brackets. See Step #4 on how to test relaying mail! DATA - tells the SMTP server that what follows is the body of your email. Make sure to hit "Enter" at the end. . - the period alone on the line tells the SMTP server you're all done with the data portion and it's clear to send the email. quit - exits the TELNET session. Test SMTP relay Testing SMTP relay is very easy, and simply requires a small change to the above commands. See below: ehlo mydomain.com mail from:<martin9700@mydomain.com> rcpt to:<recipient@someotherdomain.com> data 4.This is a test, please do not respond . quit See the difference? On the RCPT TO line, we're sending to a domain that is not controlled by the SMTP server we're sending to. You will get an immediate error is SMTP relay is turned off. If you're able to continue and send an email, then relay is allowed by that server. Print

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com) 1 of 2

02/10/2012 03:36 p.m.

Test Email flow using SMTP commands - Spiceworks Community

http://community.spiceworks.com/how_to/show/11

What do 1.5 million IT Pros do with Spiceworks?


Network Monitoring Network Configuration Management Help Desk Tools Network Management Network Troubleshooting SQL Server Monitoring Managed Service Platform Solution PC Inventory Network Mapping Network Inventory Online Community for IT Pros TFTP Server Active Directory Management Request for Quote (RFQ) IT Purchase Workflow Bandwidth Monitoring Change Management Cloud Computing Management IT Asset Management Software Inventory Auditing Green IT Management Virtual Server Discovery SNMP Monitoring UPS Power Management

Create PDF files without this message by purchasing novaPDF printer (http://www.novapdf.com) 2 of 2

02/10/2012 03:36 p.m.

You might also like