Java 8 はサポートが終了しており、2026 年 1 月 31 日に
非推奨になります。非推奨になると、過去に組織のポリシーを使用して以前のランタイムのデプロイを再度有効にしていた場合でも、Java 8 アプリケーションをデプロイできなくなります。既存の Java 8 アプリケーションは、
非推奨になる日付以降も引き続き実行され、トラフィックを受信します。
サポートされている最新バージョンの Java に移行することをおすすめします。
一括メールのガイドライン
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。
アプリケーションで一括メールを送信する場合、つまり、同じようなメッセージを多数の受信者に送信する場合は、このガイドラインに沿って操作してください。このガイドラインに従って、配信リストのすべての受信者が実際にメールの受信を希望していることを確認することは、Gmail ユーザーの受信トレイへの到達率改善につながります。受信者が手動でメールを迷惑メールに分類すると、同じ送信者から Gmail に送信されるメールがすべて迷惑メールに分類される可能性が高くなります。
メールの送信について詳しくは、Mail API の概要をご覧ください。
認証と識別
- すべての一括メールに同じ送信者を使用します。Mail API 関数を呼び出してメールを送信すると、
From
ヘッダーは指定した送信者に設定されます。
- 送信者のアドレスは、Google Workspace ドメインのアカウントであることが必要です。無料トライアル期間中のドメイン、またはユーザーが 6 人未満のドメインについては、迷惑メールに分類されるメールの送信数が非常に多い場合に、Google アカウントが一時的に無効になる可能性があります。このような場合、Mail API は
Unauthorized sender
エラー メッセージとともに例外をスローします。
- メールに DKIM で署名します。App Engine を使用して送信する場合は G Suite ドメインが必要です。
- SPF レコードを公開して、スパマーがエンベロープ送信者アドレスを偽装してなりすますのを防ぎます。SPF は、エンベロープ送信者の DNS レコードに公開されている IP アドレスからメールが送信されていることを確認します。App Engine のエンベロープ送信者は
apphosting.bounces.google.com
ドメインに所属しているため、App Engine からのメールを配信するかどうかの判断に SPF レコードが使用されない場合があります。
登録
配信リストの各ユーザーに、次のいずれかの方法でメールを受信するよう設定(オプトイン)してもらう必要があります。
- 配信登録を依頼するメールを送信する
- ウェブフォーム上やソフトウェア内でチェックボックスを手動でオンにする
サードパーティから購入したメールアドレス リストを使用した場合、オプトインとは見なされません。また、ウェブフォーム上やソフトウェア内では、デフォルトですべてのユーザーが登録されないようにチェックボックスを設定してください。つまり、ユーザーが明示的にメール配信をオプトアウトする必要がないようにします。
ウェブフォーム上やソフトウェア内でチェックボックスをオンにして登録したユーザーが、フォームで指定したアドレスで実際にメールを受信していることを確認する必要があります。受信の確認を要求するメールを送信して、ユーザーを確認します。
登録解除
- ユーザーが次のいずれかの方法で登録解除できるようにする必要があります。
- メール内にわかりやすいリンクを用意し、リンクをクリックしたユーザーは登録解除の確認の操作だけを行えばよいようにする。
- 返信でメールの登録解除をリクエストする。
- App Engine は、
[APP_ID].appspotmail.com
ドメインに送信されたメールのみを受信できます。そのため、メールの登録解除をリクエストする返信を App Engine で自動的に処理するには、送信者をこのドメインのアドレスに設定する必要があります。
- App Engine Mail API でサポートされている
List-Unsubscribe
ヘッダーを使用します。
- メールが何度も返送される場合は、そのアドレスのユーザーを自動的に登録解除します。バウンス通知を受け取るようにアプリを構成できます。
- 確認メールを定期的に送信し、登録しているメーリング リストから登録解除する機会を提示します。
- ユーザーが他のアカウントからメールを転送している可能性があるので、登録されているメールアドレスをメール内に明示的に示します。
- 書式設定は RFC 2822 SMTP 規格に従います。HTML を使用する場合は、w3.org 規格に従います。
- メールの本当の送信者やメール内のウェブリンクの本当のランディング ページを隠そうとすると、配信されないことがあります。たとえば、一括メールには URL 短縮サービスを利用しないことをおすすめします。メール本文に記載されている本当の URL を隠してしまう場合があるためです。
- 各メールの件名は、本文の内容に関連したものにして、誤解を招かないようにします。
配信
- 次の条件に該当する場合、メールが Gmail ユーザーの受信トレイに配信されやすくなります。
From
アドレスがユーザーの連絡先リストに登録されている。
- ユーザーが [迷惑メールではない] をクリックして、そのアドレスから送信されたメールを承諾することを Gmail に通知している。
- 組織に関連するプロモーション メールと取引メールの両方を送信する場合は、できるだけ目的ごとにメールを分けることをおすすめします。方法は以下のとおりです。
- 用途ごとに別のメールアドレスを使用する。
- 用途ごとに別のドメインからメールを送信する。
サードパーティ送信者
- 自分のサービスを使用してメールを送信することを他者に許可する場合は、ユーザーやクライアントの動作をモニタリングする必要があります。サービスを使用して迷惑メールを送信しているユーザーやクライアントはすべて、適切なタイミングで削除する必要があります。Google Cloud Platform 利用規定では、迷惑メールが明確に禁止されています。この規定に違反した場合、Google Cloud Platform 利用規約の規定に従って、アプリケーションが停止する場合があります。
- ユーザーやクライアントが不正行為を報告するためのメールアドレスが必要です。通常は
abuse@[YOUR_DOMAIN].com
にします。postmaster@[YOUR_DOMAIN].com
もモニタリングする必要があります。
- アプリ管理者宛に送信されるメールをモニタリングします。利用規定違反の通知など、Google からアプリ管理者に緊急に連絡を取らなければならない場合があります。Google からのメールに速やかにご返信いただければ、問題をより迅速に解決できます。
- ドメイン登録事業者が管理している WHOIS レコードの連絡先情報や、abuse.net の連絡先情報を最新の状態に維持する必要があります。
アフィリエイト マーケティング プログラム
- アフィリエイト マーケティング プログラムでは、サイトへのユーザー アクセスを促進した第三者に報酬が支払われます。これらは有益なプログラムですが、スパマーを惹きつけ、害を及ぼす可能性があります。次の点に注意してください。
- ブランドがアフィリエイト マーケティングの迷惑メールと関わりを持つと、お客様自身やお客様の他のアフィリエイトによって送信されるメールにも影響が及ぶ可能性があります。
- お客様には、アフィリエイトをモニタリングし、迷惑メールを送信しているアフィリエイトを排除する責任があります。
App Engine Mail API に代わる方法
- サードパーティのメール配信サービス プロバイダを利用して App Engine からメールを送信できます。これらのサービスは、Mail API では利用できない追加機能を提供している場合があり、一部の一括メール送信者にとって優れた解決策となることがあります。
- Sockets API を使用して、直接 SMTP サーバーに接続してメールを送信できます。
一括メールに関する制限事項
短期間に大量のメールを送信すると、Google セーフティ リミットにより、メールの一部が通知なく送信されない場合があります。これを避けるには、1 日の割り当てを 1 日の秒数である 86,400 で割り、1 秒間に送信する平均メール数を計算します。1 秒間に送信する一括メールが、この平均メール数の 50 倍を超えないようにしてください。
その他のメール送信に関する割り当てについて詳しくは、割り当て量と制限をご覧ください。
次のステップ
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 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\u003eThese guidelines are essential for improving email delivery rates to Gmail users when sending bulk emails, by ensuring recipients actually want to receive the messages.\u003c/p\u003e\n"],["\u003cp\u003eUsing a consistent sender from a Google Workspace domain, signing emails with DKIM, and publishing an SPF record are crucial for authentication and preventing email spoofing.\u003c/p\u003e\n"],["\u003cp\u003eImplementing a clear opt-in process and providing easy unsubscribe options through links, email responses, or the \u003ccode\u003eList-Unsubscribe\u003c/code\u003e header are mandatory for user management and compliance.\u003c/p\u003e\n"],["\u003cp\u003eFollowing RFC 2822 SMTP and w3.org standards for email formatting, avoiding URL shorteners, and ensuring relevant subjects are key to maintaining delivery and avoiding spam filters.\u003c/p\u003e\n"],["\u003cp\u003eIf using affiliate marketing or allowing others to use your service to send email, it's your responsibility to monitor and remove users sending spam to avoid policy violations and maintain a positive sending reputation.\u003c/p\u003e\n"]]],[],null,["# Bulk Mail Guidelines\n\nYou must follow these guidelines if your application is sending\nout bulk email, that is, similar messages to numerous recipients. These\nguidelines will help to improve your inbox delivery rate to Gmail users, by\nensuring that all recipients in your distribution list actually want to receive\nthe email. If recipients manually mark your email as spam, then that acts as a\nstrong signal to Gmail to mark future emails from you as spam.\n\nFor more information on sending mail, see the\n[Mail API Overview](/appengine/docs/legacy/standard/java/mail).\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| java-gen2\n|\n| /services/access). If you are updating to the App Engine Java 11/17 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/java-differences) to learn about your migration options for legacy bundled services.\n\nAuthentication and identification\n---------------------------------\n\n- Use the same sender for every bulk email. When calling the Mail API function to send email, the `From` header will be set to match the sender you specify.\n- Your sender address should be an account in a [Google Workspace](https://workspace.google.com/) domain. If the domain is still in the free trial period or has less than six users, Google accounts that send too many emails marked as spam might be temporarily disabled. In these cases, the Mail API will throw an exception with an `Unauthorized sender` error message.\n- Sign your email with [DKIM](https://support.google.com/a/answer/174124), which requires a G Suite domain if you are sending using App Engine.\n- Publish an [SPF record](http://support.google.com/a/bin/answer.py?answer=33786) to prevent spammers from spoofing your envelope sender address. SPF verifies that email is sent from an IP address that is published in the DNS records of the envelope sender. App Engine's envelope sender is in the `apphosting.bounces.google.com` domain, so your SPF record may not be used to determine if email from App Engine should be delivered.\n\nSubscription\n------------\n\n- Each user in your distribution list should opt-in to receive messages from you\n in one of the following ways:\n\n - By sending you an email asking to subscribe\n - By manually checking a box on a web form or within a piece of software\n- Using an email address list purchased from a third party is not considered\n opt-in. You also should not set a checkbox on a web form or within a piece of\n software to subscribe all users by default. Users should not be required to\n explicitly opt out of mailings.\n\n- You should verify that the person that signed up by checking the box on the\n web form or in software is actually receiving emails at the address that was\n specified in the form. Verify the user by sending an email that requires them\n to confirm receipt.\n\nUnsubscribing\n-------------\n\n- A user must be able to unsubscribe in one of the following ways:\n - Through a prominent link in the email with no further user interaction other than confirmation.\n - Via an email unsubscribe response.\n- App Engine can only receive email sent to the `[APP_ID].appspotmail.com` domain. Therefore, you will need to set your sender to an address in this domain if you want to automatically handle email unsubscribe responses within App Engine.\n- Use the `List-Unsubscribe` header, which is [supported by the App Engine Mail\n API](#Sending_mail_with_headers).\n- Automatically unsubscribe users whose addresses bounce multiple pieces of email. You can [configure your app to\n receive bounce notifications](#Receiving_bounce_notification).\n- Periodically send email confirmations to users, offering the opportunity to unsubscribe from each list they are signed up for.\n- Explicitly indicate the email address subscribed within your email, because users might forward email from other accounts.\n\nFormat\n------\n\n- Format to [RFC 2822 SMTP standards](http://www.ietf.org/rfc/rfc2822.txt) and, if using HTML, [w3.org standards](http://www.w3.org/standards/techs/html).\n- Attempts to hide the true sender of the message or the true landing page for any web links in the message may result in non-delivery. For example, we recommend that you do not use URL shortener services in bulk email, because these can mask the real URLs contained in the body of your email.\n- The subject of each message should be relevant to the body's content and should not be misleading.\n\nDelivery\n--------\n\n- The following factors will help messages arrive in Gmail users' inboxes:\n - The `From` address is listed in the user's Contacts list.\n - A user clicks \"Not Spam\" to alert Gmail that messages sent from that address are solicited.\n- If you send both promotional email and transactional email relating to your organization, we recommend separating email by purpose as much as possible. You can do this by:\n - Using separate email addresses for each function.\n - Sending email from different domains for each function.\n\nThird-party senders\n-------------------\n\n- If others use your service to send email, you are responsible for monitoring your users and/or clients' behavior. You must remove, in a timely fashion, all users and/or clients who use your service to send spam email. The [Google\n Cloud Platform Acceptable Use Policy](/terms/aup) specifically prohibits spam. Your application can be suspended if you violate this policy, as described in the [Google Cloud Platform Terms of Service](/terms).\n- You must have an email address available for users and/or clients to report abuse, which should normally be `abuse@[YOUR_DOMAIN].com`. You should also monitor `postmaster@[YOUR_DOMAIN].com`.\n- Monitor email sent to app admins. Google may need to urgently contact app admins, for example to notify you of a violation of the Acceptable Use Policy. We can help you to resolve the problems more quickly if you respond promptly to our emails.\n- You must maintain up-to-date contact information in your WHOIS record maintained by your domain registrar, and on [abuse.net](http://abuse.net/).\n\nAffiliate marketing programs\n----------------------------\n\n- Affiliate marketing programs reward third-parties for bringing visitors to your site. These programs are attractive to spammers and can potentially do more harm than good. Please note the following:\n - If your brand becomes associated with affiliate marketing spam, it can affect the email sent by you and your other affiliates.\n - It is your responsibility to monitor your affiliates and remove them if they send spam.\n\nAlternatives to the App Engine Mail API\n---------------------------------------\n\n- You can use a third-party email delivery service provider to send email from App Engine. These services may provide additional features that are not available in the Mail API and may be a better solution for some bulk email senders.\n- You can use the [Sockets API](../sockets) to connect directly to an SMTP server to send email.\n\nLimits for bulk mail\n--------------------\n\nIf you send too many emails in a short burst, some emails might be silently\ndropped due to Google safety limits. To avoid this, calculate the maximum daily\nrate of emails sent per second by dividing your daily quota by 86,400, the\nnumber of seconds in a day. Do not send bulk email at a rate higher than 50\ntimes the maximum daily rate.\n\nFor more information on other quotas around sending mail, see\n[Quotas and limits](/appengine/docs/legacy/standard/java/mail#quotas_and_limits).\n\nWhat's next\n-----------\n\n- Read the [Mail API\n Overview](/appengine/docs/legacy/standard/java/mail).\n- Learn how to [send\n mail with the Mail API](/appengine/docs/legacy/standard/java/mail/sending-mail-with-mail-api)."]]