Email sending failure

hi @adam

(sorry for the delay, I was off and script runs daily).

With this block

    Write-Output "Email sending failed. Reason: $($_.Exception.InnerException.Message)"
    Write-Output $_.Exception.InnerException.StackTrace
    Continue

I had no output.

I put back:

    Write-Output "Email sending failed. Reason: $($_.Exception.Message)"
    Write-Output $_.Exception.StackTrace
    Continue

And now I got:

Some background information:

  • the job normally runs before office hours, at 6:00 AM
  • on a Windows server install (service is running as local system)
  • usually, at that time my user account is disconnected, and I am not logged in to PowerShell Universal

When I re-run the job from the UI (no change in parameters whatsoever), there is no problem/error whatsoever, emails are sent as intended

Is there anything I can investigate?

Thanks,
F.