If you want to send an email via Powershell, e.g. to test if a local SMTP server is able to receive incoming email, you can use the following Powershell command:
Send-MailMessage -SmtpServer 192.168.1.10 -Port 25 -From leendert@lanedirt.tech -To test@lanedirt.tech -Subject test -Body test
Replace the example values in the command above to the credentials used in your situation:
- -SmtpServer
- Servername (DNS) or IP address of the server which is able to receive email
- -Port
- The port of the SMTP server. By default this is port 25.
- -From
- The email address of the sender.
- -To
- The email address of the receiver.
- -Subject
- Subject of the email.
- -Body
- Body of the email.