Solved

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

Posted on 2009-04-07
8
538 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
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Pop culture is prime bait for hackers seeking to infect user’s computers and mobile devices with malicious malware. Hackers know exactly what the latest trends are online and know how to use them to their advantage.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…

820 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