I'm writing a script that replies to every email coming in.
I have made a rule to run on all incoming messages that runs a script, sets the category, and marks as read. The rule sets the category and marks as read, but doesn't run the script. Below is my code:
Sub reply(Item As Outlook.MailItem)
MsgBox "Hey this script is running!"
On Error GoTo ErrorTrap
Dim MsgReply As Outlook.MailItem
Set MsgReply = Item.reply
With MsgReply
.Subject = "Welcome to IT Business Builder"
.HTMLBody = "This is just a test"
.Body = "This is just a test"
.Send
End With
Set MsgReply = Nothing
ErrorTrap:
MsgBox Err.Number & " " & Err.Description & " message not sent because of error"
End Sub
After running the rule, no message box pops up, no emails are sent.