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:


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.