Send-PnPMail not working using Task Scheduler #4138
Unanswered
IfEyeOnlyKnew
asked this question in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Just wondering if there is something that need to be added in Task Scheduler for a ps1 script to run when using Send-PnPMail command
Send-PnPMail -From "email.address" -To "email.address" -Subject "Test message" -Body "This is a test message" -Server smtp-yourserver -ServerPort 587 -EnableSsl:$true -Username "email.address" -Password "password"
Program/script: "C:\Program Files\PowerShell\7\pwsh.exe"
Add argument: -ExecutionPolicy ByPass -NoLogo -NoProfile -File "C:\Scripts\file.ps1"
Beta Was this translation helpful? Give feedback.
All reactions