Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Gmail, Gmail dışı istemciler için standart IMAP, POP ve SMTP protokollerini destekler. Gmail IMAP, POP ve SMTP sunucuları, sektör standardı olan OAuth 2.0 protokolü üzerinden yetkilendirmeyi destekleyecek şekilde genişletildi.
Protokol
IMAP, POP ve SMTP, kullanıcıların kimliğini doğrulamak için yerleşik yerel IMAP AUTHENTICATE, POP AUTH ve SMTP AUTH komutlarını kullanarak standart Basit Kimlik Doğrulama ve Güvenlik Katmanı (SASL)'nı kullanır. SASL XOAUTH2 mekanizması, istemcilerin kimlik doğrulama için OAuth 2.0 kimlik bilgileri sağlamasına olanak tanır. SASL XOAUTH2 protokolü dokümanlarında, SASL XOAUTH2 mekanizması ayrıntılı olarak açıklanır. Protokolü uygulayan kitaplıklar ve örnekler de mevcuttur.
imap.gmail.com:993 adresindeki IMAP sunucusuna ve pop.gmail.com:995 adresindeki POP sunucusuna gelen bağlantılar için SSL gerekir. Giden SMTP sunucusu smtp.gmail.com, TLS'yi destekliyor. İstemciniz düz metinle başlıyorsa STARTTLS komutunu vermeden önce 465 bağlantı noktasını (SSL için) veya 587 bağlantı noktasını (TLS için) kullanın.
Oturum süresi sınırları
Gmail POP oturumları yaklaşık 7 günle sınırlıdır. Gmail IMAP oturumları yaklaşık 24 saatle sınırlıdır. Oturum, OAuth kimlik bilgileri kullanılarak kimliği doğrulandıysa kullanılan erişim jetonunun geçerlilik süresiyle (genellikle 1 saat) sınırlıdır. Bu bağlamda oturum, kesintisiz bir TCP bağlantısıdır.
Süre dolduğunda ve oturumun süresi sona erdiğinde Gmail, oturumun süresinin sona erdiğini belirten bir mesajla bağlantıyı kapatır. Ardından, istemci yeniden bağlanabilir, tekrar kimlik doğrulayabilir ve devam edebilir. OAuth kullanıyorsanız kullanılan erişim jetonunun geçerli olduğundan emin olun (1 saatten eski bir erişim jetonunu kullanmaya çalışırsanız jeton geçersiz olabilir).
Kitaplıklar ve Örnekler
IMAP veya POP kullanarak e-postalara erişme ve SMTP kullanarak e-posta gönderme işlemleri, kolaylık sağlamak için genellikle mevcut IMAP ve SMTP kitaplıkları kullanılarak yapılır. Bu kitaplıklar Simple Authentication and Security Layer (SASL)'ı desteklediği sürece Gmail tarafından desteklenen SASL XOAUTH2 mekanizmasıyla uyumlu olmalıdır.
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-08-29 UTC."],[],[],null,["# IMAP, POP, and SMTP\n\nFor 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.\n\nProtocol\n--------\n\nIMAP, POP, and SMTP use the standard [Simple Authentication and Security Layer (SASL)](https://tools.ietf.org/html/rfc4422), 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](/workspace/gmail/imap/xoauth2-protocol) describes the SASL XOAUTH2 mechanism in great detail, and [libraries and samples](/workspace/gmail/imap/xoauth2-libraries) which have implemented the protocol are available.\n\nIncoming 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).\n\nSession length limits\n---------------------\n\nGmail 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](https://en.wikipedia.org/wiki/Transmission_Control_Protocol).\n\nWhen 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).\n\nLibraries and Samples\n---------------------\n\nAccessing 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)](https://tools.ietf.org/html/rfc4422), they should be compatible with the SASL XOAUTH2 mechanism supported by Gmail.\n\nIn addition to the SASL XOAUTH2 [protocol documentation](/workspace/gmail/imap/xoauth2-protocol), you may also want to read [Using OAuth 2.0 to Access Google APIs](https://developers.google.com/identity/protocols/OAuth2) for further information on implementing an OAuth 2.0 client.\n\nThe [Libraries and Samples](/workspace/gmail/imap/xoauth2-libraries) page provides code samples in a variety of popular languages using the SASL XOAUTH2 mechanism with either IMAP or SMTP."]]