Send an e-mail (deprecated) windows 8.1

I am trying to configure a task to send an email whenever an event on the event viewer created, I am facing the following error message:the following error was reported:2147750704 ?
Also in the drop down menu it shows (Send an e-mail (deprecated)) is there a solution ? why this feature been taken off ? and If not is there an alternative to get alerts from event viewer ?
appreciate your help.



Change it to the following:
$From = "eventidxxx@domain.com"
$To = "recipient@domain.com"
$Cc = "ccrecipient@domain.com"
$Attachment = "c:scriptsfilename.ext"
$Subject = "Event ID xxx triggered"
$MsgBody = Get-EventLog "Event Log type" -newest 2 | Where-Object {$_.EventID -eq xx} | format-list
$MailServer = "smtpserver.domain.com"
$SMTPPort = "25"

send-mailmessage -from $From -to $To -cc -$Cc -subject $Subject -body $MsgBody -stmpserver $MailServer -port $SMTPPort -attachments $Attachment

Below is an example to pull Event ID 29 from Applications Log:
$MSGBody = Get-EventLog "Application" -newest 2 | Where-Object {$_.EventID -eq 29} | format-list



By default microsoft removed that function in windows 8. No idea why.

There are however workarounds.

Here is a good tutorial that explains how to use the message function:
http://www.askvg.com/fix-cant-create-tasks-to-display-messages-in-windows-8-task-scheduler/

If you use a command line mail sender tool then you can also send an email.



Refer to the link below on how to fix it, it seems like MS has removed two features from Task Scheduler and one of them is email. One thing you could do is when you create the task, select it to run a program. The program you will run will something like:
powershell.exe -file "c:scriptseventidxxx.ps1"

You will be running PowerShell and your script could look something like this:
$From = "eventidxxx@domain.com"
$To = "recipient@domain.com"
$Cc = "ccrecipient@domain.com"
$Attachment = "c:scriptsfilename.ext"
$Subject = "Event ID xxx triggered"
$MsgBody = "Your email message body"
$MailServer = "smtpserver.domain.com"
$SMTPPort = "25"

send-mailmessage -from $From -to $To -cc -$Cc -subject $Subject -body $MsgBody -stmpserver $MailServer -port $SMTPPort -attachments $Attament



Hi Kyodai,
Thank you for your help, I have seen that post and it explains how to get msg to work but not sending email with full details

Hi Mohammed,
your solution is interesting but I need to include all the information in the email body , information like user and description, I would be grateful if you could let me know how



Change it to the following:
$From = "eventidxxx@domain.com"
$To = "recipient@domain.com"
$Cc = "ccrecipient@domain.com"
$Attachment = "c:scriptsfilename.ext"
$Subject = "Event ID xxx triggered"
$MsgBody = Get-EventLog "Event Log type" -newest 2 | Where-Object {$_.EventID -eq xx} | format-list
$MailServer = "smtpserver.domain.com"
$SMTPPort = "25"

send-mailmessage -from $From -to $To -cc -$Cc -subject $Subject -body $MsgBody -stmpserver $MailServer -port $SMTPPort -attachments $Attachment

Below is an example to pull Event ID 29 from Applications Log:
$MSGBody = Get-EventLog "Application" -newest 2 | Where-Object {$_.EventID -eq 29} | format-list



Thank you for the quick and full answer, much appreciated

Share this

Related Posts

There was an error in this gadget