Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Change 'have replies sent to' field based on internet header content of original message in Outlook

Posted on 2009-04-07
8
Medium Priority
?
559 Views
Last Modified: 2012-05-06
Hi all,
I am using ivaSoft ChooseFrom for Exchange 2003 that allows a user to send a message with any of their SMTP addresses as the from address.

The user does this by adding 'smtp:my.name@my2nddomain.com' to the 'have replies sent to' field.

'ChooseFrom' on the Exchange server then sets the SMTP address accordingly.

If the field is blank the usual default email address is used (my.name@my1stdomain.com)

I have implemented a macro driven button on the toolbar that will start a new email with a specific address in the 'have replies sent to' field. That works fine(see code part A)

The problem I have is when a message comes in to the user @my2nddomain.com and the user wants to reply to it.

I don't want the user to have to run any extra code at this point and so I am trying to find a way to use the reply event.

If the user has an email selected (not opened) in the inbox or the email is opened and they click on the reply button, I want to check the Internet Header of the originating email to see if it contains the address '@my2nddomain.com'

If it does then the blank email that is presented to the user should have the 'have replies sent to' field filled out accordingly.('smtp:my.name@my2nddomain.com')

I have redemption installed and have interrogated the internet header using code Part B to set a variable 'myIsIt2nd', but cannot see how to use this the way that I want as I cannot get it to run when the reply button is pressed.

I suspect that using inspectors is the way to go, but I have never used them before.

Any suggestions would be appreciated.


Code Part A ************************
Sub my2nddomainemail()
    Dim msg As Outlook.MailItem
    Set msg = Application.CreateItem(olMailItem)
    msg.ReplyRecipients.Add ("smtp:my.name@my2nddomain.com")
    msg.Display
    Set msg = Nothing
End Sub
**********************************
 
Code Part B ************************
    Dim utils, oItem, PrHeaders, myHeader
    Set utils = CreateObject("Redemption.MAPIUtils")
    PrHeaders = &H7D001E
    myHeader = utils.HrGetOneProp(myItem.MAPIOBJECT, PrHeaders)
 
    If InStr(1, myHeader, "@my2nddomain.com") Then
        myIsIt2nd = "yes"
    Else
        myIsIt2nd= "no"
    End If
**********************************

Open in new window

0
Comment
Question by:duanelitchfield
  • 5
  • 3
8 Comments
 
LVL 9

Expert Comment

by:IvaSoft
ID: 24093869
Believe me, this problem is harder than you can imagine. Don't you want to just use SmartReply Outlook add-in?

Regards,
Victor
0
 

Author Comment

by:duanelitchfield
ID: 24094795
Thanks for your response Victor,

I guess it looks more complicated than I first thought.

I have just looked at SmartReply and while it would give the user a chance to choose which SMTP mail address to use, it means that they have to make the choice each time they respond to an email that they want to use the alternate emailaddress for.

My experience is that users tend to have a shorter memory than the average goldfish and this would lead to emails being sent with the default(wrong) address more often than not.

Not that I am knocking my users (without them I would not have a job!) but just being realistic.

If you have any pointers or info to get me looking down the right track to get me started even, that would be great.

Regards,
Duane
0
 
LVL 9

Expert Comment

by:IvaSoft
ID: 24099237
Duane,

a quote from SmartReply product description:

"The message can be replied with the same From adddress as original message has been sent to. "

It means that users do not nedd to select anything after pressing Reply.

I'd recommend you to test SmartReply yourself.

Thanks,
Victor
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:duanelitchfield
ID: 24102921
Victor,

Ohh do I feel a bit silly. I totally missed that.

I will look into it when I am back in the office in the morning.

Thanks for taking the time to point it out.

It's a shame there's not an easier way to catch that pesky reply event in VBA though.

Regards,
Duane
0
 

Author Comment

by:duanelitchfield
ID: 24137243
OK, I looked at smart reply and it does indeed reply using the smtp address that the email was sent to. However we use a disclaimer product on the exchange server (exclaimer) that adds the users signature and a disclaimer.

The signature and disclaimer are based upon which email address the user is sending the email from. Part of the reason for my initial question was so that I could also insert a keyword in to the subject of the email so that the disclaimer software could see it, remove it and add the correct signature and disclaimer as neeeded.

When using smartreply there is no way to 'catch' the email and do this.

So I guess my original question stands. How can I interrupt the 'reply' event in outlook.
0
 
LVL 9

Expert Comment

by:IvaSoft
ID: 24139782
Please explain if your disclaimer softaware can set an appropriate  signature and disclaimer based on the From: address that has been set by ChooseFrom.

Thanks,
Victor
0
 

Author Comment

by:duanelitchfield
ID: 24183304
Sorry for the delay in getting back to you.

I can see what you mean, but it looks like the disclaimer is applied on the server before ChooseFrom gets its hands on it.

I cannot see how to choose which gets the message first via any obvious options. However it seems to me that there may be a registry setting or similar to set in what order event sinks/hooks get processed.

I'll look in to it.

0
 

Accepted Solution

by:
duanelitchfield earned 0 total points
ID: 25515277
It took a while, but I knocked up a basic exchange store event sink and used information from here http://support.microsoft.com/kb/895239  to register it.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

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

If something goes wrong with Exchange, your IT resources are in trouble.All Exchange server migration processes are not designed to be identical and though migrating email from on-premises Exchange mailbox to Cloud’s Office 365 is relatively simple…
Eseutil Hard Recovery is part of exchange tool and ensures Exchange mailbox data recovery when mailbox gets corrupt due to some problem on Exchange server.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Suggested Courses

972 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