Email Parser

Extract data from incoming emails and automate your workflow

MENUMENU

How to capture an email address in the email body and send an autoresponse

October 27, 2017

Recently a user has asked if it is possible to capture (parse) an email address written in the email body, not in the From, To, CC etc. and sending an automatic reply to that address. The answer is that parsing email addresses is very easy as they have a very well defined format:

name@domain.com

Some of them even have an indefinite number of subdomains:

name@subsubdomain.subdomain.domain.topleveldomain

 

Searching in our recommended site for a regular expression that matches an email address we have found this one:

\w+@\w+(\.\w+)+

Which, in plain English means: a string of letters followed by a @ and another string of letters. It follows another string of letters preceeded by a dot, and this last subset can be repeated many times.

This regular expression will not match some weird email addresses, but 99.9% of them will. For the purpose of showing how to parse email addresses is enough but you can use more powerful ones.

read more …