每次傳送大量電子郵件時,請皆使用相同的寄件者。呼叫 Mail API 函式傳送電子郵件時,系統會將 From 標頭設定為符合您指定的寄件者。
您的寄件者地址應該是位於 Google Workspace 網域中的帳戶。如果網域仍處於免費試用期或使用者數目不到 6 人,且 Google 帳戶傳送的電子郵件中有太多遭使用者標示為垃圾郵件,則系統可能會暫時停用這些 Google 帳戶。在這種情況下,Mail API 會擲回含有 Unauthorized sender 錯誤訊息的例外狀況。
請使用 DKIM 對電子郵件進行簽署,但如果您是使用 App Engine 傳送郵件,則必須採用 G Suite 網域。
請發布 SPF 記錄,防止垃圾內容發布者假冒您的郵件寄件者地址。SPF 會驗證傳送電子郵件的來源是否為郵件寄件者的 DNS 記錄中發佈的 IP 位址。App Engine 的郵件寄件者位於 apphosting.bounces.google.com 網域中,所以系統可能不會使用 SPF 記錄來判斷是否應傳送來自 App Engine 的電子郵件。
[[["容易理解","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\u003eFollow specific guidelines when sending bulk emails to improve delivery rates to Gmail users and avoid being marked as spam.\u003c/p\u003e\n"],["\u003cp\u003eEnsure users opt-in to receive messages, avoid using purchased email lists, and provide a clear method for users to unsubscribe, such as a prominent link or email response.\u003c/p\u003e\n"],["\u003cp\u003eAdhere to email formatting standards, including RFC 2822 and w3.org, and avoid tactics that hide the true sender or landing page to prevent non-delivery.\u003c/p\u003e\n"],["\u003cp\u003eMonitor the behavior of users and/or clients if they are using your service to send email, and promptly remove those who send spam to avoid violating Google Cloud Platform's Acceptable Use Policy.\u003c/p\u003e\n"],["\u003cp\u003eConsider using a third-party email delivery service or the Sockets API as alternatives to the App Engine Mail API, and manage your sending rate to avoid exceeding Google's limits, which may result in dropped emails.\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/go111/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| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-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.\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/go111/mail#quotas_and_limits).\n\nWhat's next\n-----------\n\n- Read the [Mail API\n Overview](/appengine/docs/legacy/standard/go111/mail).\n- Learn how to [send mail with the Mail API](/appengine/docs/legacy/standard/go111/mail/sending-receiving-with-mail-api)."]]