Home » PHP » PHP Import Email Addresses from Gmail Accounts

PHP Import Email Addresses from Gmail Accounts

How to import user email addresses from gmail account using php.Now I’m going to explain how to import email addresses using google auth API.
The Google Contacts Data API allows client applications to view and update a user’s contacts. Contacts are stored in the user’s Google Account; most Google services have access to the contact list.


First you must add or manage the domain name in the Google account by using following url.

More Information about this.

1-Add your domain name here.
Add or Manage a Domain name-Google

2-Verify your domain name(if added new domain name).

3-After the successfully message click in the “Continue” link.Then display a new page to Agreement.But still domain name is inactive status.Click that button to agree and manage the domain name.

4-Now fill the fields in the manage domain name page.Then click in the “Save” Button.

5-After save,you can view your “Consumer Key” and “Consumer Secret”.Copy these info and paste in your config file.


Ok.Now Domain name is created.Then check php_curl extension is enabled in the web server.
Add your keys in the Config.php file.


Creating the GmailOath.phpfile.


Creating Contacts.php file.


Finally Create index.php file.

That’s all.

View Demo

Download Source(8.5 KB)


Similar posts

  • Pingback: PHP Get unread Emails count in Gmail Account - FAQ()

  • Mary Smith

    Our Gmail Tech Support Engineer Read More2 for Account Setting or Change Password we help you 24*7 any types of gmail problem.

  • test fdgdffgd

    It is not working by clicking view demo

    • Hi,
      The demo is not working and I have disabled that page for security purposes.
      Please follow the guideline and run it in your web server or localhost. Must be work.


  • Jared

    Thanks for your article!
    When I need to import gmail contacts in my Magento, I used Invitations extension by Plumrocket. A superb tool, when you need to import your contacts fast!