Go 1.11 已終止支援,並將於 2026 年 1 月 31 日
淘汰。淘汰後,您將無法部署 Go 1.11 應用程式,即使貴機構先前使用機構政策重新啟用舊版執行階段的部署作業也一樣。現有的 Go 1.11 應用程式在
淘汰日期過後,仍會繼續執行並接收流量。建議您
遷移至最新支援的 Go 版本。
使用第三方服務傳送訊息
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
App Engine 上的 Go 1.11 應用程式可以使用第三方公司傳送電子郵件、簡訊或撥打及接聽電話。例如,您可發送電子郵件以確認業務交易、確認使用者帳戶的建立,或傳送行銷通訊內容。
本頁面列舉一些在 App Engine 上為 Go 1.11 應用程式提供通訊服務和用戶端程式庫的公司範例。
Mailgun
Mailgun 為電子郵件傳送作業提供符合 REST 樣式的 API 和用戶端程式庫,並為所有使用者提供免費配額。如要進一步瞭解額外電子郵件的價格和大量寄件折扣,請使用申請網頁中的月費計算工具。
進一步瞭解 Mailgun:
Mailjet
Mailjet 是全球電子郵件服務,可為 App Engine 使用者提供免費配額。如要利用這項服務,請點選下列連結來建立 Mailjet 帳戶。
進一步瞭解 Mailjet:
SendGrid
您可以使用 SendGrid 來強化 App Engine 上的電子郵件收發功能。SendGrid 可改善郵件遞送能力,讓您清楚瞭解電子郵件從應用程式傳送後的實際情形。您可以透過 SendGrid 介面或其 API 查看郵件的開啟次數、點選次數、取消訂閱數、遭回報為垃圾內容的次數等相關統計資料。
App Engine 客戶可透過 Google Cloud 主控台申請 SendGrid Email API 方案,享有免費配額。請注意,如果客戶註冊付費帳戶,Google 會獲得補償。
進一步瞭解 SendGrid:
透過 Twilio 使用簡訊和語音服務
您可以使用 Twilio 在應用程式中嵌入語音、VoIP 和訊息傳遞功能。Twilio 平台中包含 Twilio 標記語言 (TwiML)、符合 REST 樣式的 API,以及適用於網路瀏覽器、Android 與 iOS 的 VoIP SDK。
進一步瞭解 Twilio:
在應用程式中新增用戶端程式庫和第三方 API 金鑰
如要在 App Engine 開發和部署環境中提供用戶端程式庫,請將程式庫指定為依附元件。
大多數第三方服務都會使用 API 金鑰來驗證您的應用程式。您可以在第三方網站中產生金鑰。如要在應用程式中使用金鑰,建議您執行以下操作:
將金鑰新增至應用程式
app.yaml
檔案中的環境變數區段。
例如:
env_variables:
EMAIL_API_KEY: key-from-third-party
從應用程式程式碼的環境變數中擷取金鑰。
根據第三方 API 的要求傳送金鑰。
請注意,凡是可存取您的 app.yaml
的使用者,也都能存取您的 API 金鑰。如果您無法將 app.yaml
儲存在安全位置,建議您將 API 金鑰儲存在安全位置 (例如 Datastore 模式中的 Firestore),並在執行階段擷取金鑰,或是將金鑰保留在程式碼中,但使用 Cloud Key Management Service 等金鑰存放區加密金鑰。如要瞭解各項方法的優點,請參閱「選擇密鑰管理解決方案」。
除非另有註明,否則本頁面中的內容是採用創用 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\u003eGo 1.11 applications on App Engine can utilize third-party services for email, SMS, and voice communication.\u003c/p\u003e\n"],["\u003cp\u003eMailgun, Mailjet, and SendGrid offer email services with RESTful APIs and client libraries, some including free quotas for App Engine users.\u003c/p\u003e\n"],["\u003cp\u003eTwilio provides SMS, voice, and VoIP services through their platform, including TwiML, a RESTful API, and VoIP SDKs.\u003c/p\u003e\n"],["\u003cp\u003eThird-party API keys should be securely stored, either in the \u003ccode\u003eapp.yaml\u003c/code\u003e file's environment variables, or in more secure locations like Firestore or Cloud Key Management Service, and retrieved at runtime.\u003c/p\u003e\n"],["\u003cp\u003eThe services offered by these third party companies are not covered by the App Engine Service Level Agreement.\u003c/p\u003e\n"]]],[],null,["# Sending Messages with Third-Party Services\n\nGo 1.11 applications on App Engine can use third-party companies to\nsend email, SMS messages, or make and receive phone calls. For example, you\nmight send email to confirm business transactions, confirm the creation of user\naccounts, or send marketing communications.\n\nThis page lists some examples of companies that provide communication services\nand client libraries for Go 1.11 applications on App Engine.\n| **Note:** The services offered by these third-party companies are not covered by the [App Engine Service Level Agreement](/appengine/sla).\n\nMailgun\n-------\n\n[Mailgun](https://www.mailgun.com/) provides\nboth RESTful APIs and client libraries for sending email, along with a free\nquota for all users. See the monthly pricing calculator on\n[the sign up page](http://www.mailgun.com/google)\nfor pricing on additional messages and volume discounts.\n\nLearn more about Mailgun:\n\n- [Mailgun developer documentation](https://documentation.mailgun.com)\n- [Mailgun client libraries](https://documentation.mailgun.com/en/latest/libraries.html#libraries)\n\nMailjet\n-------\n\n[Mailjet](https://www.mailjet.com/google/?p=google)\nis a global email service that offers a free quota for App Engine users.\nTo take advantage of this offer, click the following link to\n[Create a Mailjet account](https://www.mailjet.com/google/?p=google).\n\nLearn more about Mailjet:\n\n- [Mailjet developer documentation](https://dev.mailjet.com/email/guides/getting-started/)\n- [Mailjet client libraries](https://dev.mailjet.com/email/guides/libraries/)\n\nSendGrid\n--------\n\nYou can use [SendGrid](https://sendgrid.com/)\nto power your emails on App Engine. SendGrid can improve your\ndeliverability and provide transparency into what actually happens to those\nemails your app sends. You can see statistics on opens, clicks, unsubscribes,\nspam reports and more with the SendGrid interface or its API.\n\nApp Engine customers can take advantage of a free quota by signing up\nfor the [SendGrid Email API plan](https://console.cloud.google.com/launcher/details/sendgrid-app/sendgrid-email) through the Google Cloud console. Note that\nGoogle is compensated for customers who sign up for a paid account.\n\nLearn more about SendGrid:\n\n- [SendGrid developer documentation](https://sendgrid.com/docs/for-developers/)\n- [SendGrid client libraries](https://sendgrid.com/docs/Integrate/libraries.html)\n\nSMS and Voice Services via Twilio\n---------------------------------\n\nYou can use Twilio to embed voice, VoIP, and messaging into applications. The\nTwilio platform consists of the [Twilio Markup Language (TwiML)](http://www.twilio.com/docs/api/twiml),\na [RESTful API](http://www.twilio.com/docs/api/rest),\nand VoIP SDKs for web browsers, Android, and iOS.\n\nLearn more about Twilio:\n\n- [Twilio developer documentation](https://www.twilio.com/docs/)\n- [Twilio client libraries](http://www.twilio.com/docs/libraries)\n\nAdding client libraries and third-party API keys to your app\n------------------------------------------------------------\n\nTo make client libraries available in your App Engine development\nand deployment environments,\n\n[specify the library as a dependency](/appengine/docs/legacy/standard/go111/specifying-dependencies).\n\n\nMost third party services use API keys to authenticate your app. You generate\nthe keys on the third-party's site. To use those keys in your app, we recommend\nyou do the following:\n\n1. Add the key to\n the environment variables section in your app's\n `\n\n app.yaml\n\n ` file.\n\n For example: \n\n env_variables:\n EMAIL_API_KEY: key-from-third-party\n\n2. In your app's code, retrieve the key from your environment variables.\n\n3. Pass the key as required by the third party's API.\n\nNote that **anyone with access to your `app.yaml` will also have access to your\nAPI keys** . If you can't store `app.yaml` in a secure location, we recommend you\nstore the API keys in a secure location such as\nFirestore in Datastore mode (Datastore) and retrieve\nthe keys at runtime, or keep the keys in your code but encrypt them with a\nkeystore, such as Cloud Key Management Service. To learn about the advantages of each\napproach, see [Choosing a secret management\nsolution](/kms/docs/secret-management#choosing_a_secret_management_solution)."]]