Troubleshooting SMTP Connectivity
On a few occasions, I've encountered application developers having difficulty with their application when it tries to send an email via an internal Exchange (or other SMTP) server. This email might be part of a workflow or notification of a job completing, for example.If you want to see what's happening, outside of the developer environment, running a few SMTP commands from the developer's computer can help.
First, you need to telnet to port 25 on your Exchange or SMTP server. Then, send an email to a sample recipient and see how you get on. Hopefully, if there is a problem with authentication or anti-virus or something similar, you will get stopped along the way and you'll be able to troubleshoot the cause.
The commands in yellow, above, are my user input. The rest of the text is messages that SMTP responds with. Note that it is sensitive to spaces in the correct places and I've found that using backspace to correct typos from a Windows command prompt does not go down well. Type carefully!
- ehlo domain.local - here, I am announcing where I am coming from
- mail from: sender@domain.local - this is the sender address
- rcpt to: recipient@domain.local - this is the recipient of the email
- data - announcing that I have finished the addressing and am about to start with the data
- subject: Test Message - the subject line of the email
- . - I have finished my input and the email may be sent
Getting stopped or getting different messages at different stages along this path will mean different things, but this will hopefully put you in the right direction.