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