[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Automatic response system

Posted on 2005-04-19
11
Medium Priority
?
291 Views
Last Modified: 2010-04-08
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.
0
Comment
Question by:TerenceHewett
  • 5
  • 3
  • 3
11 Comments
 
LVL 15

Expert Comment

by:will_scarlet7
ID: 13819806
Would you be looking to build your own customised Auto reply?
http://www.experts-exchange.com/Applications/MS_Office/Outlook/Q_21098069.html
0
 

Author Comment

by:TerenceHewett
ID: 13822762
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.
0
 
LVL 15

Expert Comment

by:will_scarlet7
ID: 13822822
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
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:TerenceHewett
ID: 13822845
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.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 13907729
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
0
 

Author Comment

by:TerenceHewett
ID: 13910779
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.
0
 
LVL 76

Expert Comment

by:David Lee
ID: 13912945
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.
0
 

Author Comment

by:TerenceHewett
ID: 13915907
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.
0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 13931858
Terry,

Sorry to be slow in getting this to you, especially since the change is so minor.  Here are the instructions for setting this up and using it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code below and paste it into the right-hand pane of the VB Editor window
5.  Edit the code making the changes per the comments I embeded in the code
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools->Macro->Security
9.  Set the Security Level to Medium.  
10.  Close Outlook
11.  Create the file to hold the sequence number and seed it with a starting number.
12.  Start Outlook
13.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.
14.  Test the macro by having someone send you a message.  
15.  When the message arrives the macro will run and generate a response.  You should receive a dialog-box saying that an application is accessing your email and asking if you want to allow it to.  Say yes.  When the macro sends the response you'll see another dialog-box saying an application is trying to send a message and asking for your permission to allow it to.  Say yes again.  These dialog-boxes are a part of Outlook's built in security made necessary by the many viruses and worms that have been written to use it as a transport mechanism.  There are various ways to get around all or part of them depending on what version of Outlook you use.  First, you can sign the code.  Here's a link to instructions on doing that: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_dsvba.asp
Second, you can use ClickYes (http://www.contextmagic.com/express-clickyes/), a small utility that'll click the Yes button for you.  It creates a security hole though, since a virus could start sending messages and ClickYes would click the Yes button for it too.  Third, disable Outlook's security features.  I wouldn't recommend that one.



'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, _
        olReply As Outlook.MailItem
    'Change the file and path name on the next line as needed
    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)
    Set olReply = Item.Reply
    With olResponse
        .To = olReply.Recipients(1)
        'Change the following 2 lines as needed.  If you want to send an HTML response, then change .Body to .HTMLBody
        .Subject = "Confirmation of email receipt. Your reference is: " & intReferenceNumber
        .Body = "We received your email."
        .Send
    End With
    Set olResponse = Nothing
    Set olReply = Nothing
End Sub
'Macro Ends Here
0
 
LVL 15

Expert Comment

by:will_scarlet7
ID: 13933601
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.
0
 

Author Comment

by:TerenceHewett
ID: 13970154
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
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article describes how to import Lotus Notes Contacts into Outlook 2016, 2013, 2010 and 2007 etc. with a few manual steps. You can easily export and migrate Lotus Notes contacts into Microsoft Outlook without having to use any third party tools.
The core idea of this article is to make you acquainted with the best way in which you can export Exchange mailbox to PST format.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question