Re: Extracting email addres from the body

2004-02-06 Thread MAU
Hello Marten,

 Anyone know if there's a way of extracting an email address from the
 body of an email and using that as the 'from' address to allow me to
 send the message to a 'subscribe' to an email newsletter that they
 want to be subscribed to.

I manage several mailing lists and newsletters and I have different
set-ups to achieve what you want depending on where the subscription
request comes from and if the request is a form filled in on a website
or just any message.

For the more general case, where the e-mail address is somewhere in the
body and not following a known patter like E-mail: [EMAIL PROTECTED] where
Regex could be used to automatically find the address, I do the
following:

- Either with Incoming or Read filters, or even moving them manually,
the messages and up in a folders I call Subs.

- In Subs, I have a folder template for new messages as follows:

,- [  New template in Subs ]
| %From=%From=[EMAIL PROTECTED]%-
| %QINCLUDE=ADNL
`-

ADNL is a QT as follows:

,- [ ADNL, subscribe to Newsletter ]
| %Clear%-
| %FROM=%FROM=%TOADDR%-
| %TO=%TO=[EMAIL PROTECTED]%-
| %SUBJECT=News%-
| %Cursor
`-

So, what I do while viewing a message in Subs folder is to double click
on the e-mail address [EMAIL PROTECTED] that I want to subscribe. This
opens the editor with my address in From and [EMAIL PROTECTED] in To, and
when ADNL is executed voila! [EMAIL PROTECTED] is moved to From: and To:
is filled in with [EMAIL PROTECTED] and only thing I have to
do is hit Send.

Now, I have another approach to process information requests that come
from a form in my website. Because the way the form is set up, the From
address is that of the person who filled in the form. My approach is a
bit different for these messages. First because I can use the From: and
second because I make a distinction based on the country the person is
writing from. The form includes Country: field all by itself in a line,
like:

Country: Spain

And what I want to do is to subscribe those from Spain to a newsletter in
Spanish and otherwise the the English version.

What I do here is use a Read filter that, aside of moving the message to
a Processed folder, includes an action (selected on the Actions tab) to
generate an auto-reply using a template. This is the template:

,- [ Auto-reply template ]
| %FROM=%FROM=%OFROMNAME %OFROMADDR%-
| %SUBJECT=Add lead%-
| %REPLYTO=%REPLYTO=%OFROMNAME %OFROMADDR%-
| %IF:%REGEXPTEXT=Spain=Spain:%QINCLUDE=ADNT:%QINCLUDE=ADNL
`-

ADNL is shown above and ADNT is the same except that the To: will be
[EMAIL PROTECTED]

Hope it helps.

-- 
Best regards,

Miguel A. Urech (El Escorial - Spain)
Using The Bat! v2.01.3
Winamp OFF:



Current version is 2.02.3 CE | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html


Re: Extracting email addres from the body

2004-02-06 Thread jwayne
On Friday, February 6, 2004, 11:25:23 AM, Marten Gallagher [EMAIL PROTECTED] wrote:

MG Anyone know if there's a way of extracting an email address from the
MG body of an email and using that as the 'from' address to allow me to
MG send the message to a 'subscribe' to an email newsletter that they
MG want to be subscribed to.

MG I.e: an e-commerce site sends me an email that has a load of guff
MG about their order, icldues their email address and if they ahe ticked
MG YES to getting a newsltter I need to send thee mail address to a
MG different email account for the newsletter controlling programme to
MG collect and act on.

Yeah, you can do about anything if you can get past an often obscure macro
language that often depends on regular expressions.

Here's an example from one of my eBay confirmation templates:

Original message has in the text:

Buyer: johndoe: mailto:[EMAIL PROTECTED]

The following is part of a reply template. It extracts the email info above and puts 
it in the
To field.

%TO='%setpattregexp=(?i-s)(Buyer\: +)(.+\:)(.+)%RegExpBlindMatch=%Text%SUBPATT=3'

Hope this helps -

jon
-- 
 [EMAIL PROTECTED]



Current version is 2.02.3 CE | Using TBUDL information:
http://www.silverstones.com/thebat/TBUDLInfo.html