Testing SMTP Server using SMTPDIAG tool

I have been using a Microsoft diagnostic tool to test mail flow called SMTPDIAG. I used it on my cloud server to confirm that all the conditions required for successful mail delivery were met. The tool tests SMTP and DNS. Click here to download the tool.

Once downloaded run SmtpDiag.EXE and extract the files to a location of your choice. Then open a command prompt, go to that location and run the following command:

smtpdiag from@yourdomain.com recipient@theirdomain.com

The first parameter from@yourdomain.com is the email address that the tool is sending the email from and the second parameter recipient@theirdomain.com is the receiving email address. The tool will run through a basic set of tests and will flag any issues it encounters. To view more diagnostic information run the same command with a /v switch at the end.

smtpdiag from@yourdomain.com recipient@theirdomain.com

A sample test I ran can be seen below:

20130427232109

You can see that the recipient has a Gmail address so the tool will test name resolution for the domain gmail.com and comfirm it has the relevant MX records. You will notice that the first test result shows this failure:

Failed to connect to the domain controller. Error: 8007054b

This error can be ignored as the server is not an Exchange server and it not part of an Active Directory domain.

The results confirm that SMTP and DNS resolution is working fine!

You can also use telnet and Powershell to test mail sending/routing via SMTP Server. Please refer to this link to see how to do this.

  • Ismail

    all my test pass

    • japinator

      What happens when you try to send yourself an email?

  • Pingback: Testing SMTP Server using SMTPDIAG tool | vSysad « nileshnaik()

  • http://gravatar.com/saintcore Saint

    Hi. Thanks for posting this.
    Is there any firewall configuration that must be made beforehand? Thanks.

    • japinator

      Hi Saint. Regarding firewall config, the first thing to do is open outbound traffic on port 25 as the SMTP Server uses this port. Do not open inbound port 25 traffic as it is not advisable to run the SMTP Server as a mail relay. Another issue to pay attention to is DNS, this must be working on the server in order to route mail successfully. Hope this helps.

  • Pingback: Testing SMTP Server from the command line | vSysad()

  • SaintSatan

    Hi , all of my test pass exept the last one who return me a lot of 10060 errors .
    Help me please :/

    • japinator

      Hi, please provide more info – send me the exact error output from the tool.

  • Ehsan akbar

    Hi guys .i opened the outbound on 25 but here is my problem :Connecting to mx4.hotmail.com [65.55.33.135] on port 25.

    • japinator

      Can you telnet directly to mx4.hotmail.com on port 25 and get a response?