'Powershell Script for sending emails doesn't work, but no errors
i've been trying to build a small powershell script, to inform employees via email if their windows OS is not up to date, i was planning to use our own email relay to send those emails, so i wanted to use this script to test sending out the email
Send-MailMessage -SmtpServer '<ip of email relay>' -To '<employee email>' -From '<central email>' -Subject 'test' -Body 'this is a test' -Port 25
now when i run this script powershell says the script has been executed, no errors, but the email is never sent/received. Is there anything i'm missing here ?
edit: we are running hmailserver as our local smtp server
Solution 1:[1]
The first step to review is.
If the central email user have enough permissions to relay email.
Then you could review if the pc or laptop where the script is executed is in the list of connections allowed to relay through the SMTP. To Review this setting you need check the Route configuration in your email server.In this link you will find the settings related on how and where emails for specific domains should be delivery
And you should review your client firewall make sure your firewall is not blocking port 25 or 587.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 |