Solved

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

Posted on 2009-04-07
8
528 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
 

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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Exchange server is not supported in any cloud-hosted platform (other than Azure with Azure Premium Storage).
This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
The video tutorial explains the basics of the Exchange server Database Availability groups. The components of this video include: 1. Automatic Failover 2. Failover Clustering 3. Active Manager
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now