Solved

Auto Forwarding, but changing the reply address.

Posted on 1998-12-29
2
231 Views
Last Modified: 2012-06-21
I have a virtual domain with my ISP and e-mail is setup with *@mydomain.com all routed to me@myisp.com. This way a@mydomain.com and b@mydomain.com are all sent to me@myisp.com, but the TO: field is still kept a@mydomain.com, etc. I then have a network setup with one system that has Internet access, and outlook 98 checks the e-mail, then forwards via a Win95 MS Mail Postoffice to the correct people on the postoffice depending on the TO: field from the Internet mail. The system doing the forwarding is setup with a Postoffice account called "InternetMail", so that is who they reply to when they get forwarded e-mail addresses. Is there a way to do one (or both) of the following...

1) Change the reply address on the forwarded message to the FROM: field of the orinal Internet e-mail.
2) Append the FROM: field of the original Internet e-mail to the body of the message being forwarded.

This would make it alot easier for people to reply. They do have the ability to send Internet mail from their systems if the to address is Internet style.

If you need a more detailed explanation e-mail me at harley@aracnet.com

Thanks,
Josh

P.S. I DO NOT need to know how to setup rules for forwarding, deleting, etc., I have already done that. I just need to change the reply address or append it.
0
Comment
Question by:Draco
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 2

Accepted Solution

by:
Bodya earned 200 total points
ID: 1622387
The most convenient way - to write a VB programm which scans your Inbox and check's the incoming mail and changes the From field according to the information in the message's body.
What I have discovered is the following: one can't programmatically change the address contained in a FROM field.
But there is a bypass: you can change so called "Have replies sent to" field.
First I explain that it will do you not harm, if you change this Field but not From field. In Outlook you can edit the View of your folder and select which fields to show and which not. Also it is the "Have replies sent to" field that defines to whom the Outlook will send the letter if you click on Reply. So, here I just tried to persuade you that changing the "Have replies sent to" field to the address from where your message have been originated can solve all your problems in Outlook and you needn't to bother about the FROM field.

The are following general steps
--------------------------------------
1. Get reference to the Outlook instance and NameSpace, for example
set oApp = CreateObject("Outlook.Application")
set oNS = oApp.GetNameSpace("MAPI")

2. Obtain the reference to your folder, where all forwarded mail items are expected to be found. This may be

Set oFolder = oNS.GetDefaultFolder(olFolderInbox)
'or
Set oFolder = oNS.Folders("Personal Folders").Folders("Inbox")

3. Write an iteration loop which processes all items in your folder

For Each oItem In oFolder.Items
  If TypeName(oItem) = "MailItem" Then
      'call the procedure to process a mailitem
      ProcessMailItem oItem
  End If
Next

4. What is left now - is to write the procedure which looks for the original address in the message body, extracts it and put just in the "Have replies sent to" field . It can be like this

Private Sub ProcessMailItem(oItem As Object)
Dim strTemp As String
Dim BeginAddress As Integer
Dim EndAddress As Integer
Dim strAddress As String

'here you should check, if the item is a forwarded letter
strTemp = oItem.Subject
If Not strTemp Like "FW:*" Then Exit Sub
strTemp = oItem.Body
BeginAddress = InStr(1, strTemp, "From:") + 6
EndAddress = InStr(BeginAddress, strTemp, vbNewLine)
'here we are trying to find an address
strAddress = Mid(strTemp, BeginAddress, EndAddress - BeginAddress)

      'remove all old values from the "Have replies sent to" field and add a new one
While oItem.ReplyRecipients.Count = 1
oItem.ReplyRecipients.Remove 1
Wend
Item.ReplyRecipients.Add (strAddress)
oItem.ReplyRecipients.ResolveAll
oItem.Save
End Sub

This routine, of cause, is only a carcass of real routine that must handle various exceptions etc.
Finally you should write a routine to make the programmm automatically scan your inbox in a certain periods of time.
---------------------------------------------------

More information about programming Outlook on VB you can get  from
http://www.microsoft.com/OutlookDev/Articles/outprog.htm

Good luck,
Bodya

P.S. Of cause such a programm may be already written , but isn't it a fancy to make it by yourself. May be I will write it myself when I will have a little more time, 'cause you are not the fisrt person who asks such a question.
0
 

Author Comment

by:Draco
ID: 1622388
Thanks for all of the info, I haven't gotten to try it out yet, but it looks like it should work and makes sense, the only thing I don't see is where the message is actually sent out. At this point we have rules setup (we are using Outlook98) to automatically forward the message when new mail comes in. I assume that would be changed, but the question is when I modify the reply to field the message is going to have to be sent right away, so how do I have my program do that?

It is an excellent answer so far, there are just a few things that I need cleared up a little.

Thanks,
Josh
0

Featured Post

SuperAntiSpyware Licenses Discounted by 25% !

Exclusive offer to Experts Exchange Members!
Buy SuperAntiSpyware License(s) from us and save 25% on the regular purchase price.
- Includes Full SuperAntiSpyware Vendor Support Entitlements
- Your Subscription does not begin until you activate your license
- Buy for your friends

Question has a verified solution.

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

Find out what you should include to make the best professional email signature for your organization.
Changing a few Outlook Options can help keep you organized!
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: …
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

738 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