How to schedule a script and setup email notification via Task scheduler or any other way?

Mytoast Admin 285 Reputation points
2024-04-27T07:12:30.42+00:00

How to schedule a script and setup email notification via Task scheduler or any other way?

As I have gone through some blogs and online links but its shows traditional ways and seems "Email Send" option is deprecated in Task Scheduler.

See below snap

User's image

Windows for business | Windows Server | User experience | PowerShell
Windows for business | Windows Client for IT Pros | User experience | Other
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Russell Dyas 75 Reputation points
    2024-04-27T12:45:45.5133333+00:00

    Hello

    As send-mailmessage is not recommended in powershell anymore you could use a third party like Mail Slurp. Then run the PowerShell script using task scheduler

    1. https://www.mailslurp.com/blog/powershell-send-email/
    2. https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/send-mailmessage?view=powershell-7.4
    3. https://sid-500.com/2022/08/17/how-to-include-your-powershell-7-scripts-in-task-scheduler/

    Hope this helps.

    Russell

    If the answer is helpful, please click Accept Answer and kindly upvote. If you have any further questions about this answer, please click Comment.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.