[[["容易理解","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 to handle email, SMS, and voice communication needs like transaction confirmations and marketing.\u003c/p\u003e\n"],["\u003cp\u003eMailgun, Mailjet, and SendGrid are third-party email services that offer RESTful APIs and client libraries, with some providing free quotas for App Engine users.\u003c/p\u003e\n"],["\u003cp\u003eTwilio provides a platform with TwiML, a RESTful API, and VoIP SDKs for adding voice, VoIP, and messaging functionality to applications.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries are made available in App Engine by specifying them as dependencies, such as in the \u003ccode\u003eapp.yaml\u003c/code\u003e file.\u003c/p\u003e\n"],["\u003cp\u003eAPI keys for third-party services can be stored securely using Secret Manager, encrypted with Cloud Key Management Service, or in environment variables for non-production environments.\u003c/p\u003e\n"]]],[],null,["# Sending messages with third-party services\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\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."]]