I wrote this simple script last week to test SMTP server by sending a testing email.
Usage: .\Test-SMTP.PS1 -smtp smtp.xxxx.com -port 25 -from email@example.com -to firstname.lastname@example.org
If the email is successfully, the recipient will receive an email similar to this:
The email contains the following information:
- Originating Computer: Where the script was run from
- SMTP Server Address: The SMTP server that sent this email
- SMTP Server Port: default SMTP port is 25
- Return (sender) address: This does not have to be a real address
- Recipient: Where the email is sent to.