Log in

View Full Version : Auto Reply Help



chunkd
06-19-2008, 06:36 AM
Well here is what I am trying to do just don't know how to do it. I know how to generate outgoing emails but my problem is how to handle incoming.

Well, I need to setup up a script that can be used in the rule wizard and it needs to do this: Every time I get an email I need to auto reply back to the sender with the original body email. There are no rules that can do this so I need to setup some rules then add this script. Would be nice if I can even check to see if the mail is an auto reply like out of office etc... or I will get stuck in a continuous loop of auto replying. But for now I would like to be able to auto reply to every email that I get with the original message back to the sender.

May just be able to auto forward this message back to sender? again rules will only allow you to pick someone from a distro list or specify who to forward msg to, I need to auto send the original message back to the sender.


I don't know how to read in the body of the email or how to get the senders address into an new email.

cheers
chunkd

chunkd
06-20-2008, 08:21 AM
well got it to work and here is the code to do it !!!!!





Sub RunAScriptRuleRoutine(MyMail As MailItem)
Dim strID As String
Dim olNS As Outlook.NameSpace
Dim msg As Outlook.MailItem
Dim rply As Outlook.MailItem

strID = MyMail.EntryID
Set olNS = Application.GetNamespace("MAPI")
Set msg = olNS.GetItemFromID(strID)


Set rply = msg.Reply
rply.Body = msg.Body
rply.Subject = "What ever you want the subject to be"
'This will fill the to address as the senders address

rply.To = msg.SenderEmailAddress
rply.Send

Set msg = Nothing
Set rply = Nothing
Set olNS = Nothing
End Sub