Solved

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

Posted on 2009-04-07
8
536 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
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, fr…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

823 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