Trouble with Health Check Script Not Sending Emails

0
10
Asked By TechieNerd123 On

I'm running a health check script that generates an HTML report and is supposed to email this report both as an attachment and in the email body to our group address. However, for the past two days, the script has not been sending out the emails even though the HTML file is generated successfully each time. I've already tested the SMTP setup using a PowerShell command, and it works fine when I provide the correct credentials. I thought the issue might be related to TLS1.2, but despite implementing that, I'm still getting the same results. There haven't been any changes on the SMTP side, and the script was running perfectly until recently. I also tried executing the script directly from PowerShell instead of running it through a scheduled task. Any ideas on what I should check next?

3 Answers

Answered By SMTP_Checker07 On

Is your IP address authorized to relay through the SMTP server? Even if it was working a couple of days ago, sometimes settings can change unexpectedly. You could also think about adding logs specifically for the email-sending part to track down any errors.

TechieNerd123 -

Good point! I’ll add those logs to see if I can catch any errors related to the email sending.

Answered By ScriptGuru42 On

What do the PowerShell logs indicate? Also, have you looked at your antivirus logs? I've encountered ISP blocks in the past while trying to send emails through SMTP, so it might be worth checking that out too.

Answered By CodingWiz89 On

Have you considered adding some logging to the script? It could help you pinpoint where the issue lies. Checking your SMTP server logs is also a good idea. Plus, instead of sending the HTML as an attachment, you might want to consider hosting it on a web server and just sending a link in the email. It avoids potential attachment issues.

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.