PHP 5 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、PHP 5 アプリケーションをデプロイできなくなります。既存の PHP 5 アプリケーションは、
非推奨になる日付以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの PHP に移行することをおすすめします。
サードパーティのサービスによるメッセージの送信
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
App Engine 上の PHP 5 アプリケーションでは、メールや SMS メッセージの送信、電話の発着信にサードパーティ企業のサービスを利用できます。たとえば、ビジネス トランザクションやユーザー アカウントの作成を確認するためのメールの送信や、マーケティング関連のメール配信を行うことができます。
このページに、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 を介した SMS サービスと音声サービス
Twilio を使用すると、音声、VoIP、メッセージをアプリケーションに埋め込むことができます。Twilio プラットフォームは、Twilio マークアップ言語(TwiML)、RESTful API、VoIP SDK(ウェブブラウザ、Android、iOS 用)で構成されています。
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
を保存できない場合は、Datastore モードの Firestore(Datastore)のような安全な場所に API キーを保存して実行時にキーを取得するか、コード内にキーを保持しつつキーストア(Cloud Key Management Service など)を使用してキーを暗号化することをおすすめします。各アプローチの利点については、シークレット管理ソリューションの選択をご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2025-09-04 UTC。
[[["わかりやすい","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 UTC。"],[[["\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)."]]