SMTP Server Test Using PowerShell

  1. Run PowerShell as an administrator:

  2. Enter the user credentials. That is the Office 365, GSuite, etc., email address and password.

    In PowerShell, type $msolcred = get-credential and press <Enter>. Enter the email address and password here, and click OK:

  3. Sending the test email:

    In PowerShell, type: Send-MailMessage –From mail@yourcompany.com –To user@yourcompany.com –Subject “Test Email” –Body “Test Text” -SmtpServer smtp.office365.com -Credential $msolcred -UseSsl -Port 587, and press <Enter>.

    smtp.office365.com is shown as an example; you may insert another SMTP server address, such as smtp.gmail.com.

  4. If all worked correctly, a test email should be received.