0
votes

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 ?

1
Does the email relay have any trace of the message submission? - Mathias R. Jessen

1 Answers

0
votes

Have you reviewed the central email user have enough permissions to relay email, also if the pc or laptop where the script is executed is in the list of connections allowed to relay through the SMTP and you should review your client firewall make sure your firewall is not blocking port 25 or 587.