![]() |
|
|||||||
| ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum? |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
There is an existing application that received 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? We need the email between the tags <> where the Reply-To is specified. Any help would be most appreciated as i am trying to do it for a few days aleady. Many Thanks fig 1 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: <xx@walla.com> From: "avital xxx" <email@email.com> To: ttt@business.gmail.com 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: <xx-PCOeI011@xx-PC.yy-uu.local> X-OriginalArrivalTime: 11 Feb 2008 17:15:56.0040 (UTC) FILETIME=[C3498880:01C86CD1] Return-Path: email@email.com Fig 2 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 = "someemail@mail.com" 'This sets the to address on the reply MailMessageReply.EmailAddress = replyToAddress |
|
This ad is part of our Revenue Sharing program |
|
||||
|
in this situation a Regular Expression may come in handy. They are complicated, but once you understand it, it makes life much eassier. The RegExp you are looking for is something like:
"^Reply-To: <?[a-zA-Z0-9@_\-\.]+>?^" with the "i" tag This is a good site for understanding Regular Expressions: Regular Expressions in Visual Basic 6 - VB RegExp |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Trouble with loadXML from string | joderilli | JavaScript & AJAX Forum | 2 | 08-30-2007 06:36 AM |