Go 1.11 已終止支援,並將於 2026 年 1 月 31 日
淘汰。淘汰後,您將無法部署 Go 1.11 應用程式,即使貴機構先前使用機構政策重新啟用舊版執行階段的部署作業也一樣。現有的 Go 1.11 應用程式在
淘汰日期過後,仍會繼續執行並接收流量。建議您
遷移至最新支援的 Go 版本。
接收退件通知
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
為了能接收到電子郵件的退件通知,您需要設定應用程式來啟用電子郵件通知,並建立處理常式來處理這些通知。
設定您的應用程式來接收退件通知
設定分成兩個部分。第一,您必須啟用通知。其次,您需要設定 /_ah/bounce
與退信處理常式之間的對應關係,讓 App Engine 知道要將通知資料 POST 到哪裡。如何設定應用程式來接收退件電子郵件通知:
- 將以下內容新增到
app.yaml
檔案以啟用通知:inbound_services:
- mail_bounce
- 另外,在
app.yaml
中,宣告 /_ah/bounce
與您程式碼中退件通知處理常式之間的對應,例如:- url: /_ah/bounce
script: _go_app
login: admin
處理退信通知
您必須在應用程式中,提供退件處理常式程式碼才能接收和處理通知。
系統會以 POST 要求傳送彈出通知至您的應用程式,並傳送至 /_ah/bounce
。退件的相關資訊在要求的內文中會是經過編碼的形式。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-09-04 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["難以理解","hardToUnderstand","thumb-down"],["資訊或程式碼範例有誤","incorrectInformationOrSampleCode","thumb-down"],["缺少我需要的資訊/範例","missingTheInformationSamplesINeed","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-09-04 (世界標準時間)。"],[[["\u003cp\u003eTo get email bounce notifications, you must enable email notifications in your app and create a handler for them.\u003c/p\u003e\n"],["\u003cp\u003eEnable bounce notifications in your \u003ccode\u003eapp.yaml\u003c/code\u003e file by adding \u003ccode\u003einbound_services: - mail_bounce\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIn \u003ccode\u003eapp.yaml\u003c/code\u003e, map \u003ccode\u003e/_ah/bounce\u003c/code\u003e to your bounce handler, specifying where to POST notification data.\u003c/p\u003e\n"],["\u003cp\u003eYour bounce handler will receive POST requests to \u003ccode\u003e/_ah/bounce\u003c/code\u003e, containing form-encoded bounce information.\u003c/p\u003e\n"]]],[],null,["# Receiving Bounce Notification\n\nIn order to receive email bounce notifications, you need to configure\nyour app to enable email notification and you need to create a handler\nto handle those notifications.\n\nConfiguring Your App to Receive Bounce\nNotifications\n----------------------------------------------------\n\nThere are two parts to the configuration. First, you need to enable\nnotification. Second, you need to set the mapping between\n`/_ah/bounce` and your bounce handler, so App Engine knows where to\nPOST the notification data. To configure your app to receive bounced email\nnotifications:\n\n1. Add the following to your `app.yaml` file to enable notification: \n\n ```scdoc\n inbound_services:\n - mail_bounce\n ```\n2. Also in `app.yaml`, declare a mapping between `/_ah/bounce` and the bounce notification handler in your code, for example: \n\n ```scdoc\n - url: /_ah/bounce\n script: _go_app\n login: admin\n ```\n\nHandling Bounce Notifications\n-----------------------------\n\nIn your app, you'll need to supply bounce handler code to receive and\nprocess the notifications.\n\nThe bounce notification will be sent to your app as a POST request to\n`/_ah/bounce`. Information about the bounce will be form-encoded in\nthe body of the request."]]