There is an existing application that receives emails and if i view the header i see fig 1.
The application comes with an admin interface where we can add some rules to incoming emails.
What happens currently is that in the email when we reply to an incoming email the To: field shows the email specified in the Return-Path: in fig 1 below.
We need the To to show the email in Reply-To (bold below).
We were provided by the application developers a script to add in the administration interface to do what we need (fig2).
However, we don't need the email to be hardcoded but need to retreive it for each email. How do we parse the email from the header?
Any help would be most appreciated as i am trying to do it for a few days aleady.
Many Thanks
[u]
fig 1</u>
Received: from xx-PC.xxx([23.@@@@]) by company with Microsoft SMTPSVC(6.0.3790.3959);
Mon, 11 Feb 2008 19:15:50 +0200
Received: from mail pickup service by xx-PC.tt-yy.local with Microsoft SMTPSVC;
Mon, 11 Feb 2008 19:15:56 +0200
Reply-To: <[email protected]>
From: "avital xxx" <
[email protected]>
To:
[email protected]
Subject: subject test idimail
Date: Mon, 11 Feb 2008 19:15:55 +0200
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="----=_NextPart_000_001C_01C86CE2.86AF1910"
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
Message-ID: <
[email protected]>
X-OriginalArrivalTime: 11 Feb 2008 17:15:56.0040 (UTC) FILETIME=[C3498880:01C86CD1]
Return-Path:
[email protected]
[u]
Fig 2</u>
Dim emailHeaderString
Dim ReplaceString
'this contains the entire email header
'you will have to parse out the reply to address
emailHeaderString = MailMessage.EmailHeader
Dim replyToAddress
replyToAddress = "
[email protected]"
'This sets the to address on the reply
MailMessageReply.EmailAddress = replyToAddress