I had an interesting problem with a SMTP gateway this week because one of its internal processes had failed the server was processing mail down to the TO verb in the SMTP Protocol exchange and then failing with a specific Status code. Usually you could detect this type of fault by looking at growing queue sizes or delayed delivery times but I wanted a solution that would go out and proactively check the SMTP verbs on a mail server so I could make sure that I would be alerted if there was any issue with anything going on in the SMTP stack. A while ago I posted a SMTP test script for Powershell which simulated a telnet test against port 25 using Powershell. Using this as a base I streamlined the code to stop outputting information to the commandline and added some logic to parse the first 3 characters from the exchange SMTP response which will relate to the SMTP status code. If everything is going well with your SMTP box you should get a 250 status code see for a full list of stat
Pushing the Envelope in Messaging and Office 365 Development