Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 11th, 2008, 07:36 PM
Authorized User
 
Join Date: Oct 2003
Posts: 89
Thanks: 0
Thanked 0 Times in 0 Posts
Default manipulate strings with vbscript

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


 
Old February 21st, 2008, 04:42 PM
Authorized User
 
Join Date: Jan 2008
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Search for substring within header string:
substr = "Reply-To: <[email protected]>"

When find substring, use < as delimiter. Use > as ending delimiter.
Strip email addr out, & you're good to go.





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to manipulate diagramms? zip Crystal Reports 1 June 12th, 2006 11:20 AM
how to manipulate recordsets allang PHP Databases 1 September 25th, 2004 01:21 PM
manipulate recordset k2_andy Access VBA 1 May 30th, 2004 05:46 PM
manipulate variable Thodoris SQL Server 2000 2 May 28th, 2004 03:27 AM
how to manipulate recordset allang Classic ASP Databases 1 November 3rd, 2003 05:30 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.