Link to home
Start Free TrialLog in
Avatar of TerenceHewett
TerenceHewett

asked on

Automatic response system

Hi EE,

I have been given the task of creating an autoresponse email for people who email us.   Any email coming from our customerservice email address automatically receives an autoresponse that advises them that their email has arrived.  I need to find a way so that the subject line in the autoresponse contains an automatic number which the recipient can use as a reference number.

For example, if we receive an email from our website form to the customerservice email address, the autoresponse would say something like this:

Subject line: Confirmation of email - reference number: YYMMDD-<autonumber>

Your email has been received....blah blah blah etc...

Is this possible?

Thanks.
Terry.
Avatar of will_scarlet7
will_scarlet7

Would you be looking to build your own customised Auto reply?
https://www.experts-exchange.com/questions/21098069/Customised-Auto-Reply-to-Specific-Mails.html
Avatar of TerenceHewett

ASKER

Hi Sam,

Thanks for your post. Maybe the link from one of your old responses will help me, but I am basically looking for a solution so that each auto-response goes back out to the recipient with a different reference ID in the subject heading. For example:

A message has come in to my inbox from a customer. That customer receives an auto-response that says something like "thanks for your message. we confirm receipt and will be in touch."

Within that auto-response, I would like the subject heading to contain a reference number (but different for each auto-response sent out.  For example:

Auto-reply 1 : Subject: Confirmation of email receipt. Your reference is: 12345
Auto-reply 2 : Subject: Confirmation of email receipt. Your reference is: 12346
Auto-reply 3 : Subject: Confirmation of email receipt. Your reference is: 12347
and so on...

Does the above make any sense to you?

Any help would be appreciated.

Many thanks,
Terry.
Hi Terry,
   The actual solution from my previous auto-reply solution would not likely fit your situation. I mainly posted it to show how a custome reply solution could be built using VBA, which is the only way that I know of to develop something that does the type of custom actions that you are refering to.

There might be a simpler solution, but my suggestion would be:
1.) Create a Custom Reply MACRO in VBA
2.) Connect to an Access database to get a unique reply reference number and record that number, along with details about the email replied to.

I'm preparing to catch a train to the Airport in a few hours, so I would not be able to get into the nuts and bolts of such a system today, but perhaps (if no one else is able to supply you with and alternative solution, and you can wait) I could work on it a bit tomorrow and through the end of the week.

God bless!

Sam
Hi Sam,

I would really appreciate your help with this. I am in no immediate rush, and would welcome anything that you could offer.  Not a professional in VBA, although I have dabbled in VBA for MS Access in the past.

Thanks again for all your help and advice.

Have a safe journey.

Best wishes,
Terry.
Avatar of David Lee
Terry,

I've written the macro below that will generally do what you requested.  To make it fully functional I need to know what version of Outlook you'll be using it with.  I'll make final code changes and post instructions on how to set it up and use it as soon as you provide the Outlook version.

'Macro Begins Here
Private WithEvents objInboxItems As Items

Private Sub Application_Startup()
    Dim objNS As NameSpace
    Set objNS = Application.GetNamespace("MAPI")
    Set objInboxItems = objNS.GetDefaultFolder(olFolderInbox).Items
    Set objNS = Nothing
End Sub

Private Sub Application_Quit()
    Set objInboxItems = Nothing
End Sub

Private Sub objInboxItems_ItemAdd(ByVal Item As Object)
    Dim objFSO As FileSystemObject, _
        objFile As TextStream, _
        intReferenceNumber As Integer, _
        olResponse As Outlook.MailItem, _
        strResponseFileName as String
    strResponseFileName = "C:\eeTesting\ResponseNumber.txt"
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    Set objFile = objFSO.OpenTextFile(strResponseFileName)
    intReferenceNumber = CInt(objFile.ReadLine)
    If intReferenceNumber = 0 Then
        intReferenceNumber = 1
    Else
        intReferenceNumber = intReferenceNumber + 1
    End If
    objFile.Close
    Set objFile = objFSO.OpenTextFile(strResponseFileName, ForWriting)
    objFile.Write intReferenceNumber
    objFile.Close
    Set objFile = Nothing
    Set objFSO = Nothing
    Set olResponse = Application.CreateItem(olMailItem)
    With olResponse
        .Subject = "Confirmation of email receipt. Your reference is: " & intReferenceNumber
        .To = Item.SenderName
        .Body = "We received your email."
        .Send
    End With
    Set olResponse = Nothing
End Sub
'Macro Ends Here
Hi Blue Devil,

Thanks for your post.  The version of Outlook is 2003.  I will try this code in the office tomorrow and let you know how it goes.

Regards,
Terry.
Hi, Terry.

I need to refine the code a little for Outlook 2003.  The code I posted above was a general approach to show one way of accomplishing this.  Butthe method of addressing a return message is different in 2003 than it was in 2002/2000.  I also need to explain a bit about Outlook security and how to implment the macro, unless of course you're already familiar with those topics.
Hi Blue Devil,

Any advice would be great on the Outlook security for 2003. I can use Outlook for its intended person, but when it comes to programming...I am pretty much a novice, although I have done some VBA in Excel and Access.

Thanks,

Terry.
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Terry & BlueDevilFan,

Another thing to get around the Security nags (especially since the "send" nag makes you wait 30 seconds before you can click "Yes") would be to install Outlook Redemption, and use it's objects in the code for the replies...

Sam

PS. Terry, sorry I could not get to this sooner. My trip ended up not giving me as much free time as I initialy anticipated. Glad BlueDevilFan was around to step in.
Hi Sam and BlueDevilFan - hey it rhymes...a double act in the making!

Glad you had a safe journey sam and no problems in not having time to look at this for me.   Thanks BlueDevilFan for your help with the above. I have not had time to look at this as I have been away for a while, but will try the suggested coding above. If I have further problems, I will send a new post.

Best regards to both,

Terry