Products G Suite Gmail IMAP Guides OAuth 2.0 Libraries and Samples The following libraries and samples make it easy to get started using OAuth 2.0 authorization to access the Gmail IMAP and SMTP services. Java Sample Getting Started Download Python Sample Getting Started Download PHP Sample Getting Started Download Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 3.0 License, and code samples are licensed under the Apache 2.0 License. For details, see our Site Policies. Java is a registered trademark of Oracle and/or its affiliates. Last updated February 14, 2017.