Search This Blog

Showing posts with label Gmail. Show all posts
Showing posts with label Gmail. Show all posts

Friday, 21 June 2013

Extract Your Email Addresses from your Gmail Folders

I have written a little utility – The Sender’s List – that will help you extract email addresses from your Gmail account. You may extract addresses from every single message in your Gmail mailbox or it can sift through emails that are tagged with a particular label (or folder).
The extracted email addresses are saved in a Google spreadsheet that you may either download as a CSV file or you can use that raw list as an input for Mail Merge. If you looking to create an email marketing campaign for your clients who are not in your Google Contacts but have previously communicated with you, The Sender’s List could be a time-saving option.
extracted email addresses
To get started, click here to create a copy of the Google Script. Next, put the name of your Gmail folder in cell A2. You may use Inbox for extracting address from mails that are in your Inbox, Starred for just the important emails or All for processing all messages.
Internally, the script pulls email addresses of senders from messages tagged with a particular label and exports them to a Google Sheet. Since the script needs to track messages that have been processed, it applies a new label to these messages and the default name of this label isProcessed. If you wish to use a different name, just replace the value of cell B2.
Now choose the Gmail menu in the Google sheet (see screenshot) and select Initialize. Grant the script access to your Gmail mailbox and then choose RunProgram from the same Gmail menu.
The Google script is now running in the background and, depending on the size of your Gmail folder, may take some time to complete. You may close the Google sheet and it will send you an email once the extraction is complete. The duplicate email addresses will automatically be removed from the final list.
 If you wish to extract addresses from another Gmail label, just create a new copy of the blank sheet and repeat the steps. Also, you may choose Gmail->Uninstall to stop the background script from running.

Use Your Twitter as a Gmail Notifier

Did you know that you can follow your Gmail account on Twitter and get notified (via tweets) as soon as new email messages arrive in your Gmail mailbox. And these are private tweets that will be only visible to you.
You can also use this trick as a workaround to receive SMS alerts for important Gmail messages on your mobile phone through Twitter. You will only have to turn on mobile notifications for the Twitter account that will be tweeting your Gmail mailbox.
There’s no programming required and you can get started in 5 minutes. I have updated this tutorial for Twitter API 1.1 and it is takes fewer steps to setup.
gmail messages in twitter timeline

Use Twitter as a Gmail Notifier with Google Scripts

Gmail does provide an RSS feed of your inbox but the problem is that if you have to auto-publish the Gmail’s default RSS feed to Twitter, you’ll have to supply your Google account credentials in plain text. That’s risky.
The following solution uses OAuth to connect your Gmail and Twitter accounts so you don’t have to share your passwords with anyone. There’s a Google Apps Script that monitors your Gmail mailbox in the background and as soon as a new message arrives in your account, the script sends out a tweet. That’s the big picture and here’s how you can implement this solution:

Step A: Create a new Twitter App for Gmail

  1. Go to twitter.com/signup and create a new Twitter account for your Gmail Inbox – mine is called myGmailInbox.
  2. Confirm your email address, then open the Twitter settings page and check the option “Protect My Tweets.” This will make your Gmail notifications private and neither search engines nor other Twitter users will be able to see tweets generated through Gmail.
  3. Go to dev.twitter.com, sign-in using your new Twitter account and create a New Twitter App.
  4. You may give your Twitter app any name, description while https://spreadsheets.google.com/macros will be the Callback URL.
  5. Make sure there are no empty spaces in the URL fields else Twitter may give an “Invalid URL format” warning. Accept the terms and conditions, fill in the CAPTCHA and submit the form to create your first Twitter application.
  6. Next go to the Settings Tab of your Twitter Application and change the “Access” mode from “Read only” to “Read and Write” since we want to publish tweets from Google Docs.
  7. Save the Settings, then switch to the tab that says OAuth Tool and make a note of the Consumer Key and the Consumer Secret Key.

Step B: Link Google Docs and Twitter

  1. Click here to make a copy of the Google Script in your Google Drive.
  2. Replace the values of TWITTER_CONSUMER_KEY and TWITTER_CONSUMER_SECRET with the actual values available on dev.twitter.com.
  3. Choose Run –> Initialize and follow the prompts to authorize the script. This is required for the script to watch your Gmail inbox at set intervals for new mails.
  4. Choose Run –> RunProgram and it should display another “Authorization Required” message from Twitter. Click Authorize to allow the Google Script to publish tweets to your Twitter Gmail account.

Step C: Follow Gmail on Twitter

  1. Log in to your old Twitter account and send a follow request to your new Gmail account on Twitter.
  2. Log in to your new Gmail account and approve the new follower. You should now see tweets for new Gmail messages, as they arrive, in your main timeline.

Get SMS Alerts for New Gmail Messages

Should you wish to receive SMS alerts on your mobile phone for new Gmail messages, just open the Twitter profile page of your Gmail bot and turn on Mobile Notifications. This will obviously work only if you have connected (and verified) your mobile phone with your main Twitter account.

One more thing. In the default setup, the Google Script watches your Gmail Inbox for all incoming mails and tweets as soon as it encounters any new messages in the mailbox.
If this generates too many tweets and text messages, you can specify a different Gmail search filter and thus receive notifications for messages only from people you care about. For this to work, you will have to change the value of GMAIL_SEARCH_STRING in the script.