PHP 5 已終止支援,並將於 2026 年 1 月 31 日
淘汰。淘汰後,您將無法部署 PHP 5 應用程式,即使貴機構先前曾使用機構政策重新啟用舊版執行階段的部署作業,也無法部署。現有的 PHP 5 應用程式在
淘汰日期後仍會繼續執行並接收流量。建議您
改用系統支援的最新 PHP 版本。
使用第三方服務傳送訊息
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
App Engine 上的 PHP 5 應用程式可以使用第三方公司的服務傳送電子郵件、簡訊或撥打及接聽電話。例如,您可發送電子郵件以確認業務交易、確認使用者帳戶的建立,或傳送行銷訊息。
本頁面列出的公司針對 App Engine 上的 PHP 5 應用程式提供通訊服務和用戶端程式庫。
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 開發和部署環境中提供用戶端程式庫,請在應用程式的 composer.json
檔案中將程式庫指定為依附元件,並從應用程式的目錄執行 composer install
。進一步瞭解 composer。
大多數第三方服務都會使用 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\u003ePHP 5 applications on App Engine can integrate third-party services for email, SMS, and voice communication, enhancing functionality like transaction confirmations and marketing.\u003c/p\u003e\n"],["\u003cp\u003eMailjet and SendGrid are email service providers offering free quotas and APIs for App Engine users, with SendGrid also providing email deliverability tracking and analytics.\u003c/p\u003e\n"],["\u003cp\u003eTwilio enables voice, VoIP, and messaging capabilities within applications, using TwiML, a RESTful API, and SDKs for web, Android, and iOS.\u003c/p\u003e\n"],["\u003cp\u003eClient libraries are added to App Engine applications by specifying them in the \u003ccode\u003ecomposer.json\u003c/code\u003e file and running \u003ccode\u003ecomposer install\u003c/code\u003e, allowing the use of the third-party service.\u003c/p\u003e\n"],["\u003cp\u003eThird-party API keys, essential for app authentication, can be managed through environment variables in \u003ccode\u003eapp.yaml\u003c/code\u003e or securely stored in services like Firestore or encrypted with Cloud Key Management Service.\u003c/p\u003e\n"]]],[],null,["# Sending Messages with Third-Party Services\n\nPHP 5 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 PHP 5 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\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\nspecify the library as a dependency in your app's `composer.json` file and run\n`composer install` from your app's directory. Learn more about\n[composer](https://getcomposer.org/).\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)."]]