 |
 |

03-12-2003, 09:35 AM
|
|
|
extracting email addresses
|
i have a couple thousand emails that have been returned to my inbox as undeliverable. i need to extract the email address that is in the body of the returned email and then send it to an access database. i've done all of this except extracting the email address. i have the body assigned to the string 'emailbody'. but how do i create a substring that contains the email address? any help would be great.
|
|

03-12-2003, 09:39 AM
|
 |
Mexican Coder
|
|
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
|
|
if your emails are separated with commas, use the split function
strEmails = "A@B.com, C@D.Com, E@F.Com,...
Dim MyEmailsArr() as String
MyEmailsArr = Split(strEmails, ",")
|
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
|

03-12-2003, 09:55 AM
|
|
|
|
nope, there's just one email address per body, and it's always in some random location within the body string.
|
|

03-12-2003, 10:02 AM
|
 |
Mexican Coder
|
|
Join Date: Jun 2002
Location: Monterrey, N.L., Mexico
Posts: 2,793
|
|
Well then you need to locate the @, then read to the previous space, and then to the next space
example:
this is your body:
Hello my friend this is my email: mike_crosoft@hotmail.com
in the 46 place is the @, then loop througth the body starts on the 46 place to back until the space (mike_crosoft@), then loop throught the body until the next space (@hotmail.com).
i hope make sense
|
__________________
Mikecrosoft.NET
* If I stop to ask I will stop to learn
* Just I know that I don't know nothing
|

03-12-2003, 10:03 AM
|
|
Retired Contributor
|
|
Join Date: Mar 2002
Posts: 1,829
|
|
Well, if there is a space before and after the address, you could "hunt" for an @ and then get everything before and after it until you hit the space?
Edit: Works for me
|
|

03-12-2003, 10:12 AM
|
 |
Lost Soul
Super Moderator * Guru *
|
|
Join Date: May 2001
Location: Vorlon
Posts: 18,887
|
|
Quote:
|
Originally Posted by radams
i have a couple thousand emails that have been returned to my inbox as undeliverable. i need to extract the email address that is in the body of the returned email and then send it to an access database. i've done all of this except extracting the email address. i have the body assigned to the string 'emailbody'. but how do i create a substring that contains the email address? any help would be great.
|
 We don't like spammers/mass mailers.
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
|
|
 |
|