So you need a simple SMTP relay test for Office 365
I have been doing a ton of Exchange migrations lately and setting up internal IIS relays to smarthost to Office 365. In this I have found many issues with firewalls and various settings IT managers like to do to keep email traffic limited. In this I have had to figure out ways to test SMTP from telnet to PowerShell and this one is my favorite so I thought I would share.
Steps (4 total)
Right Click on PowerShell and Run As Administrator
Store your Office 365 Mailbox Credentials
get-credential will prompt you for the Office 365 relay mailbox creds. you need to store this in a variable so you can call it as one bit in the next command line.
$relaycreds = get-credential
Use Send-MailMessage PowerShell Command
now we can use the creds above to send a test email message using the Send-MailMessage command. [email protected] to the same user #you just stored the relaycreds in step one. [email protected] to another email address you have under your control so you can see it relay.
Test the SMTP Relay
use the same command with a few changes to test the SMTP relay now.Do this from the server with IIS6 SMTP relay on or change localhost to the FQDN of your choice.
So really simple way to send emails now and you can see also from this command the ability to email from a scheduled task attached to event triggers. This will help you monitor your windows servers for those specific events that you care about.