Scenario: your domain: mydomain.com domain you want to send: theirdomain.com
1. Identify the mail server to which you are sending. Open prompt CMD Type
NSLOOKUP set q=mx theirdomain.com
Response:
Non-authoritative answer: theirdomain.com MX preference = 50, mail exchanger = mail.theirdomain.com Nslookup_big
EDIT Be sure to enter exit to complete NSLOOKUP.
2. Connect to your mail server
SMTP communicates on port 25. Now we will try to use TELNET to connect to our mail server "mail.theirdomain.com"
Open the CMD prompt
TELNET MAIL.THEIRDOMAIN.COM 25
You should see something like this as an answer:
220 mx.google.com ESMTP 6si6253627yxg.6
Keep in mind that different servers will have different greetings, but you should get SOMETHING. If nothing arises at this moment, there are two possible problems. Port 25 is blocked on your firewall, or their server is not responding. Try a different domain, if it works, then it's not you.
3. Send an email
Now use simple SMTP commands to send a test message. This is very important, you CANNOT use the backspace key, it will work on the screen, but will not be interpreted correctly. You must 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
So what does this mean? EHLO - introduce yourself on the HELO mail server; you can also use it, but EHLO tells the server to use an extended set of commands (and not the one we use).
MAIL FROM - who sends the email. Make sure that it is larger or smaller than in brackets, as this will require many email servers (Postini).
RCPT TO - who you send it to. Again you need to use parentheses. See Step # 4 on how to check mail relay!
DATA - tells the SMTP server that the following is the body of your message. Remember to press "Enter" at the end.
- only the period in the line tells the SMTP server that you did everything with a piece of data, and it is clear to send an email.
quit - ends a TELNET session.
4. Testing the SMTP relay Testing the SMTP relay is very simple and just requires a slight modification to the above commands. See below:
ehlo mydomain.com mail from:< martin9700@mydomain.com > rcpt to:< recipient@someotherdomain.com > data This is a test, please do not respond . quit
See the difference? In the RCPT TO line, we send a domain that is not controlled by the SMTP server to which we are sending. You will get an immediate error: SMTP relay is off. If you can continue and send an email, then relay is allowed by this server.