Go 1.11 已終止支援,並將於 2026 年 1 月 31 日
淘汰。淘汰後,您將無法部署 Go 1.11 應用程式,即使貴機構先前使用機構政策重新啟用舊版執行階段的部署作業也一樣。現有的 Go 1.11 應用程式在
淘汰日期過後,仍會繼續執行並接收流量。建議您
遷移至最新支援的 Go 版本。
使用第三方服務傳送訊息
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
App Engine 應用程式可以使用第三方公司傳送電子郵件、簡訊或撥打及接聽電話。例如,您可以發送電子郵件來確認業務交易、確認使用者帳戶的建立,或傳送行銷訊息。
本頁面列舉部分在 App Engine 應用程式中提供通訊服務和用戶端程式庫的公司範例。
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 開發和部署環境中提供用戶端程式庫,請將程式庫指定為依附元件。舉例來說,如要指定 Node.js 執行階段的依附元件,請參閱這篇文章。
大多數第三方服務都會使用 API 金鑰來驗證您的應用程式。您可以在第三方網站中產生金鑰。如要在應用程式中使用第三方 API 金鑰,請按照下列步驟操作:
將 API 金鑰儲存在 Secret Manager 中,並在執行個體開始執行時安全擷取金鑰。
使用 Cloud Key Management Service 加密金鑰,將已加密的金鑰儲存在環境變數中,並在執行個體啟動時以程式輔助方式解密。
針對非正式環境,您可以將金鑰本身儲存在環境變數中。請注意,凡是可存取 app.yaml
檔案的使用者,也都能存取您的金鑰。
如要瞭解各項方法的優點,請參閱「選擇密鑰管理解決方案」
如要將金鑰或加密的金鑰值儲存在環境變數中,請按照下列步驟操作:
將金鑰或已加密的金鑰值新增至應用程式 app.yaml
檔案中的環境變數區段。
例如:
env_variables:
EMAIL_API_KEY: key-from-third-party OR encrypted-key
如果您使用 Node.js 執行階段,請將金鑰新增至應用程式 app.standard.yaml
檔案中應用程式環境變數區段的設定變數。
從應用程式程式碼的環境變數中擷取金鑰或加密金鑰。
舉例來說,如果您使用的是 Python 執行階段:
EMAIL_API_KEY = os.environ['EMAIL_API_KEY']
根據第三方 API 的要求傳送金鑰。如果您先前已加密金鑰,請務必解密金鑰。
除非另有註明,否則本頁面中的內容是採用創用 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\u003eApp Engine applications can integrate with third-party services for email, SMS, and voice communication, allowing functions such as transaction confirmations and marketing communications.\u003c/p\u003e\n"],["\u003cp\u003eMailgun, Mailjet, and SendGrid are third-party services that offer email solutions for App Engine, each with free quotas and RESTful APIs or client libraries.\u003c/p\u003e\n"],["\u003cp\u003eTwilio offers SMS and voice services, with its platform consisting of TwiML, a RESTful API, and VoIP SDKs, for integration into App Engine applications.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries for third-party services can be made available in App Engine by specifying them as dependencies, and API keys for authentication can be stored securely using Secret Manager or Cloud Key Management Service.\u003c/p\u003e\n"],["\u003cp\u003eThird party companies who's services are offered are not covered by the App Engine service level agreement.\u003c/p\u003e\n"]]],[],null,["# Sending Messages with Third-Party Services\n\nApp Engine apps can use third-party companies to send email, SMS messages,\nor make and receive phone calls. For example, you might send email to confirm\nbusiness transactions, confirm the creation of user accounts, or send marketing\ncommunications.\n\nThis page lists some examples of companies that provide communication services\nand client libraries for App Engine apps.\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, specify the library as a dependency.\nFor example, to specify dependencies for the Node.js runtime,\nsee [here](/appengine/docs/standard/nodejs/specifying-dependencies).\n\nMost third party services use API keys to authenticate your app. You generate\nthe keys on the third-party's site. To use the third-party API keys in your app:\n\n1. Store the API keys in the [Secret Manager](/secret-manager/docs/overview) and\n [fetch the key securely](/secret-manager/docs/create-secret-quickstart) at\n instance start time.\n\n2. Encrypt the key with [Cloud Key Management Service](/kms/docs/key-management-service), store\n the encrypted key in an environment variable, and\n [decrypt it programmatically](/kms/docs/encrypt-decrypt) at instance start time.\n\n3. For non-production environments, you can store the key itself in an\n environment variable. Note that anyone with access to your `app.yaml` file\n can also access your key.\n\nTo learn about the advantages of each\napproach, see [Choosing a secret management\nsolution](/kms/docs/secret-management#choosing_a_secret_management_solution)\n\nTo store the key, or encrypted key value in an environment variable:\n\n1. Add the key or encrypted key value to the environment variables section in\n your app's `app.yaml` file.\n\n For example: \n\n env_variables:\n EMAIL_API_KEY: key-from-third-party OR encrypted-key\n\n\n If you are using the Node.js runtime, add the key to the configuration variables in your app's environment variables section in your app's `app.standard.yaml` file.\n2. In your app's code, retrieve the key or encrypted key from your environment\n variables.\n\n For example, if you are using the Python runtime: \n\n EMAIL_API_KEY = os.environ['EMAIL_API_KEY']\n\n3. Pass the key as required by the third party's API. Ensure you\n [decrypt the key](/kms/docs/encrypt-decrypt) if you encrypted it previously."]]