IMAP, POP, and SMTP  |  Gmail  |  Google for Developers (2024)

For non-Gmail clients, Gmail supports the standard IMAP, POP, and SMTP protocols. The Gmail IMAP, POP, and SMTP servers have been extended to support authorization via the industry-standard OAuth 2.0 protocol.

Protocol

IMAP, POP, and SMTP use the standard Simple Authentication and Security Layer (SASL), using the built-in the native IMAP AUTHENTICATE, POP AUTH, and SMTP AUTH commands, to authenticate users. The SASL XOAUTH2 mechanism enables clients to provide OAuth 2.0 credentials for authentication. The SASL XOAUTH2 protocol documentation describes the SASL XOAUTH2 mechanism in great detail, and libraries and samples which have implemented the protocol are available.

Incoming connections to the IMAP server at imap.gmail.com:993 and the POP server at pop.gmail.com:995 require SSL. The outgoing SMTP server, smtp.gmail.com, supports TLS. If your client begins with plain text, before issuing the STARTTLS command, use port 465 (for SSL), or port 587 (for TLS).

Session length limits

Gmail POP sessions are limited to about 7 days. Gmail IMAP sessions are limited to about 24 hours. If the session was authenticated using OAuth credentials, it's limited to about the validity period of the access token used (usually 1 hour). A session in this context is one continuous TCP connection.

See Also
Redirecting

When the time elapses and the session expires, Gmail closes the connection with a message saying that the session expired. After that, the client can reconnect, authenticate again, and continue. If using OAuth, make sure that the access token used is valid (if you try to use an access token older than 1 hour, it might be invalid).

Libraries and Samples

Accessing mail using IMAP or POP and sending mail using SMTP is often done using existing IMAP and SMTP libraries for convenience. As long as these libraries support the Simple Authentication and Security Layer (SASL), they should be compatible with the SASL XOAUTH2 mechanism supported by Gmail.

In addition to the SASL XOAUTH2 protocol documentation, you may also want to read Using OAuth 2.0 to Access Google APIs for further information on implementing an OAuth 2.0 client.

The Libraries and Samples page provides code samples in a variety of popular languages using the SASL XOAUTH2 mechanism with either IMAP or SMTP.

IMAP, POP, and SMTP  |  Gmail  |  Google for Developers (2024)
Top Articles
8 ways to pay off your student loans faster
What Can & Cannot Be Discharged in Bankruptcy | FCW Legal
Trevor Goodwin Obituary St Cloud
Gabrielle Abbate Obituary
Lexington Herald-Leader from Lexington, Kentucky
Autobell Car Wash Hickory Reviews
Bloxburg Image Ids
Displays settings on Mac
Bhad Bhabie Shares Footage Of Her Child's Father Beating Her Up, Wants Him To 'Get Help'
Carter Joseph Hopf
Epaper Pudari
Identogo Brunswick Ga
Hijab Hookup Trendy
Youravon Comcom
Haunted Mansion Showtimes Near Millstone 14
Msu 247 Football
Silive Obituary
Lola Bunny R34 Gif
Yisd Home Access Center
Ihs Hockey Systems
Yu-Gi-Oh Card Database
MethStreams Live | BoxingStreams
Www.craigslist.com Syracuse Ny
Shaman's Path Puzzle
Newsday Brains Only
Murphy Funeral Home & Florist Inc. Obituaries
Black Adam Showtimes Near Amc Deptford 8
Staar English 1 April 2022 Answer Key
Montrose Colorado Sheriff's Department
Terrier Hockey Blog
Watchseries To New Domain
Mohave County Jobs Craigslist
Anya Banerjee Feet
D-Day: Learn about the D-Day Invasion
Easy Pigs in a Blanket Recipe - Emmandi's Kitchen
Cpmc Mission Bernal Campus & Orthopedic Institute Photos
The Realreal Temporary Closure
Miami Vice turns 40: A look back at the iconic series
Kutty Movie Net
Penny Paws San Antonio Photos
Conan Exiles Tiger Cub Best Food
Bmp 202 Blue Round Pill
Holzer Athena Portal
Tlc Africa Deaths 2021
Headlining Hip Hopper Crossword Clue
Strange World Showtimes Near Marcus La Crosse Cinema
Minute Clinic Mooresville Nc
Gelato 47 Allbud
Fredatmcd.read.inkling.com
Urban Airship Acquires Accengage, Extending Its Worldwide Leadership With Unmatched Presence Across Europe
Cool Math Games Bucketball
Latest Posts
Article information

Author: Msgr. Refugio Daniel

Last Updated:

Views: 5759

Rating: 4.3 / 5 (74 voted)

Reviews: 81% of readers found this page helpful

Author information

Name: Msgr. Refugio Daniel

Birthday: 1999-09-15

Address: 8416 Beatty Center, Derekfort, VA 72092-0500

Phone: +6838967160603

Job: Mining Executive

Hobby: Woodworking, Knitting, Fishing, Coffee roasting, Kayaking, Horseback riding, Kite flying

Introduction: My name is Msgr. Refugio Daniel, I am a fine, precious, encouraging, calm, glamorous, vivacious, friendly person who loves writing and wants to share my knowledge and understanding with you.