Extract emails from gmail

0

I have a website with a contact form.

Once the user fills in the form, an email is being sent to my gmail in the following syntax:

From: Contact us form <contact-us-form@example.com>

To: example@gmail.com

Message body:

  • Name: username filled in form
  • Email: emailaddress@hotmail.com
  • Message: Hi, how are you?

I'm looking for a way to extract all the Emails that were filled in the form.. since the email from address is my own one and not the form filler one, I can't see their email address in my contacts tab.

Anyone has any idea how to do this?

user87633

Posted 2011-06-26T13:46:11.047

Reputation: 1

https://deep-email-extractor.com is your friend. Paid for but safe, secure and uses two step passwords. I bought it a few years ago and still use it, quite handy – Tino Mclaren – 2017-06-02T09:04:22.457

If you are looking for something simple to accomplish this without having to write some sort of code, how about switching to using a Form via Google Docs. The output gets stored in a spreadsheet. – mindless.panda – 2011-06-26T14:24:06.647

So on which operating system do you want to do this? Do you have access to Gmail via POP/IMAP? Are you on a graphical user interface? Does this need to happen automatically or are you looking for a one-time solution? – slhck – 2011-06-26T14:26:18.437

So what user87633 is looking for it a way to automate pulling out a portion of the message body. It could be that the question should be reworked and moved to Stack Overflow. – Kirk – 2011-06-26T19:59:26.727

Answers

1

In this article there is a discussion about using a + sign in your gmail address to help prefilter mail. So if you have the ability, you can change your contact for email address to something along the lines of your.email+contactform@gmail.com. The mail will still be delivered to your.email@gmail.com but you can filter on messages sent to your.email+contactform@gmail.com. So you can forward them off, or label them a certain way, or whatever else you might need.

Kirk

Posted 2011-06-26T13:46:11.047

Reputation: 2 182

I can filter out the messages I get from users who filled in the web form as they all have the same subject line. What I need though is to extract the emails the users filled in in the web form. – user87633 – 2011-06-26T13:58:58.420

What do you mean by extract the emails? That could mean a bunch of things in my mind. Can you be more specific about what you are trying to accomplish? – Kirk – 2011-06-26T14:00:49.463

Yes. Each email sent out from the web form includes the message that the user filled in and his Email address. It's in the message body and I am looking for an automatic way to go through all the relevant emails and extract only the Email addresses and save them to a text/csv file. Am I making sense? – user87633 – 2011-06-26T14:02:33.630

That does make sense. I used to do this in python ... the gist of the process was (and it has been ages) receive the e-mail via POP, get the body of the message, and pull out the attachments. Off hand I do not remember what the python module was I was using, but it did work very very well. – Kirk – 2011-06-26T14:14:51.033

1

Gmail provides IMAP access to their accounts.

This means, you could relatively easily have someone write a small script or application that connects to the IMAP server and downloads the contents of the mails in question. There are plenty of modules available for accessing IMAP in different programming languages, for instance:

If you wish to do it manually, you could use most standard mail clients, and add the IMAP server to it. Then you could do a search for the subject line, and export those emails in an appropriate format.

An example of such a client is Thunderbird, where you could use SmartSave to export the emails, for instance.

Sebastian Paaske Tørholm

Posted 2011-06-26T13:46:11.047

Reputation: 4 479

And Exchange access, if for some reason you wanted to do Outlook rules. – Rich Homolka – 2011-06-26T16:28:12.610