Test SMTP Relay in Office365

Test SMTP Relay in Office365

  • Comments 3
  • Likes

Hello Team, 

I am back with my 3rd blog and this blog is primarily with testing SMTP relay with Office365 for that matter this testing can be used against any email applications which does SMTP relay.

I would primarily concentrate with Office365 SMTP relay. There have been scenario with me while troubleshooting SMTP relay I really wanted some reliable tool to troubleshoot issue from customer machine or network. 

  • Telnet works awesome if your SMTP server is Office365 MX record.
  • If you use Office365 SMTP server i.e. smtp.office365.com on telnet it does not work because authentication is mandatory and for some reason I was not able to make authentication work in Telnet

After lots of research and brainstorming I was able to get awesome reliable tool i.e. PowerShell (which is installed on most of the windows machine). I am going to share the step which I used to test customer's scenario.

How to test SMTP server using PowerShell.

This command is to drop email using SMTP server

$msolcred = get-credential | save the credential of from address

Send-MailMessage –From user@domain.com –To user@hotmail.com –Subject “Test Email” –Body “Test SMTP Relay Service” -SmtpServer smtp.office365.com -Credential $msolcred -UseSsl -Port 587

This command is to drop email using MX records

Send-MailMessage –From user@domain.com –To user@hotmail.com –Subject “Test Email” –Body “Test SMTP Relay Service” -SmtpServer domain.mail.protection.outlook.com 

I hope above steps will help many admin's to affectively troubleshoot and test SMTP relay server against Office365 or any SMTP email servers.

Regards,

Santp.

Comments
  • Awesome, thanks for this post. I used this today to test relaying with another user's credentials.

  • Thanks Ryan.

  • Thank you for this useful post. I used the process and found it really helpful.If you want to check more update about smtp server, do visit http://bestsmtpserver.com/

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment