Trouble with Health Check Script Not Sending Emails

0
7
Asked By TechyTurtle99 On

I've been running health checks using a script that generates an HTML report and sends it via email, both as an attachment and in the email body to our group address. However, for the past two days, it hasn't been sending emails, even though the HTML file is generated successfully. The script appends to the HTML file on each run. I confirmed that the SMTP server works fine with a PowerShell command using the same credentials, but the email sending through the health check script is not working. We added TLS 1.2 in case that was the issue, but the results remain the same. There's been no change on the SMTP side; the script was working perfectly two days ago. We also tried running it directly from PowerShell instead of through a scheduled task, thinking there might be an issue there. Any suggestions on what to check next?

4 Answers

Answered By NetworkNinja77 On

What do your PowerShell logs indicate? And what about your antivirus logs? I've had to bypass ISP blocks before, so make sure that's not an issue here.

Answered By ScriptSage24 On

Try using Send-MailMessage directly in a terminal to mimic what the script does. Does it give you any errors? If not, look into your mail server logs to see if the send request is being received.

Answered By EmailExpert88 On

Check if your IP is still allowed to relay from the SMTP server. Since it was working just a couple of days ago, it's worth double-checking these settings.

Answered By HelpfulHacker42 On

Try adding logging to your script and also check the SMTP server logs for any errors. Instead of sending attachments, consider pointing the HTML output to a web server folder and sending a link via email. This could simplify the process and avoid unnecessary email clutter.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.