Solved

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

Posted on 2009-04-07
8
531 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 

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

Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

This article explains in simple steps how to renew expiring Exchange Server Internal Transport Certificate.
Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
The purpose of this video is to demonstrate how to set up an account with Mailchimp. This will be demonstrated using a Windows 8 PC. Tools Used are: Mailchimp.com Go to Mailchimp.com : Enter an Email, Username, and Password. Click Create My Acco…
The purpose of this video is to demonstrate how to set up a Mailchimp campaign. This will include styling and adding elements to a newsletter/email. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchim…

914 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

22 Experts available now in Live!

Get 1:1 Help Now