Webmaster Forum

Go Back   Webmaster Forum > Scripting/Programming & Debugging > ASP & VBScript Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

ASP & VBScript Forum Need help from a webmaster with ASP or VBScript, you may ask in this forum?

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-12-2008, 12:03 AM
collie collie is offline
Junior Member
 
Join Date: Feb 2008
Posts: 2
collie is an unknown quantity at this point
Send a message via Skype™ to collie
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default parse string in vbscript

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
Reply With Quote

This ad is part of our Revenue Sharing program
  #2 (permalink)  
Old 02-12-2008, 08:03 PM
ALL's Avatar
ALL ALL is offline
Senior Member
 
Join Date: Oct 2006
Location: Sturgis, SD
Posts: 145
ALL is on a distinguished road
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default

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
Reply With Quote
  #3 (permalink)  
Old 02-13-2008, 08:32 AM
collie collie is offline
Junior Member
 
Join Date: Feb 2008
Posts: 2
collie is an unknown quantity at this point
Send a message via Skype™ to collie
Submit to Clesto Submit to Digg Submit to Reddit Submit to Furl Submit to Del.icio.us Submit to Jeqq Submit to Spurl
Default Regular Expressions

Many thanks and great link :-)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


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


All times are GMT. The time now is 02:40 AM.


Creative Commons License
Powered by vBulletin Version 3.6.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.0.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30