การจัดการ POP และ IMAP
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คุณใช้การตั้งค่าเพื่อกำหนดค่า
ลักษณะการทำงานของ Gmail เมื่อเข้าถึงผ่านโปรโตคอล POP และ IMAP ได้
ดูข้อมูลเกี่ยวกับวิธี
getPop
updatePop
getImap
หรือ updateImap ได้ที่
ข้อมูลอ้างอิงการตั้งค่า
POP
การเปิดและปิดใช้การเข้าถึง
คุณควบคุมการเข้าถึง POP ได้ด้วยพร็อพเพอร์ตี้ accessWindow
พร็อพเพอร์ตี้ไม่เพียงแต่กำหนดว่าเปิดใช้ POP หรือไม่ แต่ยังกำหนดข้อความที่อาจดึงข้อมูลได้ด้วย
ค่า |
เอฟเฟ็กต์ |
disabled |
ไม่มีสิทธิ์เข้าถึง POP |
allMail |
ข้อความทั้งหมดพร้อมใช้งาน |
fromNowOn |
ใช้ได้เฉพาะกับข้อความใหม่เท่านั้น |
การจัดการข้อความ
คุณกำหนดค่าการจัดการข้อความที่ดึงข้อมูลผ่าน POP ได้ด้วยพร็อพเพอร์ตี้ disposition
ค่า |
เอฟเฟ็กต์ |
archive |
ย้ายข้อความออกจากกล่องจดหมาย |
leaveInInbox |
ไม่ต้องทำอะไร ปล่อยให้ข้อความยังไม่อ่านในกล่องจดหมาย |
markRead |
ทำเครื่องหมายข้อความว่าอ่านแล้ว |
trash |
ย้ายข้อความไปที่ถังขยะ |
IMAP
การเปิดและปิดใช้การเข้าถึง
คุณควบคุมการเข้าถึง IMAP ได้โดยตั้งค่าพร็อพเพอร์ตี้ enabled
เป็น true
หรือ false
เพื่อเปิดหรือปิดใช้การเข้าถึงตามลำดับ
การควบคุมข้อความ
หากต้องการตั้งค่าการจำหน่ายสำหรับข้อความที่ลบ ให้ใช้พร็อพเพอร์ตี้ expungeBehavior
ค่า |
เอฟเฟ็กต์ |
archive |
ย้ายข้อความออกจากกล่องจดหมาย |
deleteForever |
ลบข้อความอย่างถาวร |
trash |
ย้ายข้อความไปที่ถังขยะ |
นอกจากนี้ หากตั้งค่าautoExpunge
พร็อพเพอร์ตี้เป็น true
การดำเนินการเหล่านี้
จะดำเนินการทันทีเมื่อลบข้อความผ่าน IMAP ไม่เช่นนั้น
ระบบจะเก็บข้อความไว้จนกว่าจะมีการขอจากไคลเอ็นต์ IMAP อย่างชัดแจ้ง
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-08-01 UTC
[null,null,["อัปเดตล่าสุด 2025-08-01 UTC"],[],[],null,["# Managing POP and IMAP\n\nYou can use [Settings](/workspace/gmail/api/reference/rest/v1/users.settings) to configure\nthe behavior of Gmail when accessed via the POP and IMAP protocols.\n\nFor information on how to\n[getPop](/workspace/gmail/api/reference/rest/v1/users.settings/getPop),\n[updatePop](/workspace/gmail/api/reference/rest/v1/users.settings/updatePop),\n[getImap](/workspace/gmail/api/reference/rest/v1/users.settings/getImap),\nor [updateImap](/workspace/gmail/api/reference/rest/v1/users.settings/updateImap), see\nthe [Settings reference](/workspace/gmail/api/reference/rest/v1/users.settings).\n\nPOP\n---\n\n### Enabling and disabling access\n\nYou can control POP access with the `accessWindow` property. The property not\nonly determines whether or not POP is enabled, but also which messages may be\nretrieved.\n\n| Value | Effect |\n|-------------|---------------------------------|\n| `disabled` | No POP access |\n| `allMail` | All messages are available |\n| `fromNowOn` | Only new messages are available |\n\n### Message disposition\n\nYou can configure the disposition of messages retrieved via POP with\nthe `disposition` property.\n\n| Value | Effect |\n|----------------|------------------------------------------------|\n| `archive` | Move messages out of the inbox |\n| `leaveInInbox` | Do nothing, leave messages unread in the inbox |\n| `markRead` | Mark the messages as read |\n| `trash` | Moves the message to the trash |\n\nIMAP\n----\n\n### Enabling and disabling access\n\nYou can control IMAP access by setting the `enabled` property to `true`\nor `false`, to enable or disable access respectively.\n\n### Message Disposition\n\nTo set the disposition for deleted messages, use the `expungeBehavior` property.\n\n| Value | Effect |\n|-----------------|--------------------------------|\n| `archive` | Move messages out of the inbox |\n| `deleteForever` | Permanently delete the message |\n| `trash` | Moves the message to the trash |\n\nAdditionally, if the `autoExpunge` property is set to `true` these actions\nare performed immediately when the message is deleted via IMAP. Otherwise\nmessages are left until explicitly requested from the IMAP client."]]