Bulk Mail Guidelines Stay organized with collections Save and categorize content based on your preferences.
You must follow these guidelines if your application is sendingout bulk email, that is, similar messages to numerous recipients. Theseguidelines will help to improve your inbox delivery rate to Gmail users, byensuring that all recipients in your distribution list actually want to receivethe email. If recipients manually mark your email as spam, then that acts as astrong signal to Gmail to mark future emails from you as spam.
For more information on sending mail, see theMail API Overview.
This API is supported for first-generation runtimes and can be used whenupgrading to corresponding second-generation runtimes. If you are updating to the App Engine Python 3 runtime, refer to themigration guide to learn about your migration options for legacy bundled services.Authentication and identification
- Use the same sender for every bulk email. When calling the Mail API functionto send email, the
Fromheader will be set to match the sender you specify. - Your sender address should be an account in aGoogle Workspace domain. If the domain is still in the free trial period or has less than sixusers, Google accounts that send too many emails marked as spam might betemporarily disabled. In these cases, the Mail API will throw an exceptionwith an
Unauthorized sendererror message. - Sign your email withDKIM, whichrequires a G Suite domain if you are sending using App Engine.
- Publish anSPF record to prevent spammers from spoofing your envelope sender address. SPF verifiesthat email is sent from an IP address that is published in the DNS records ofthe envelope sender. App Engine's envelope sender is in the
apphosting.bounces.google.comdomain, so your SPF record may not be used todetermine if email from App Engine should be delivered.
Subscription
Each user in your distribution list should opt-in to receive messages from youin one of the following ways:
- By sending you an email asking to subscribe
- By manually checking a box on a web form or within a piece of software
Using an email address list purchased from a third party is not consideredopt-in. You also should not set a checkbox on a web form or within a piece ofsoftware to subscribe all users by default. Users should not be required toexplicitly opt out of mailings.
You should verify that the person that signed up by checking the box on theweb form or in software is actually receiving emails at the address that wasspecified in the form. Verify the user by sending an email that requires themto confirm receipt.
Unsubscribing
- A user must be able to unsubscribe in one of the following ways:
- Through a prominent link in the email with no further user interactionother than confirmation.
- Via an email unsubscribe response.
- App Engine can only receive email sent to the
[APP_ID].appspotmail.comdomain. Therefore, you will need to set your sender to an address in thisdomain if you want to automatically handle email unsubscribe responses withinApp Engine. - Use the
List-Unsubscribeheader, which issupported by the App Engine MailAPI. - Automatically unsubscribe users whoseaddresses bounce multiple pieces of email. You canconfigure your app toreceive bounce notifications.
- Periodically send email confirmations to users, offering the opportunity tounsubscribe from each list they are signed up for.
- Explicitly indicate the email address subscribed within your email, becauseusers might forward email from other accounts.
Format
- Format toRFC 2822 SMTP standards and, if using HTML,w3.org standards.
- Attempts to hide the true sender of the message or the true landing page forany web links in the message may result in non-delivery. For example, werecommend that you do not use URL shortener services in bulk email, becausethese can mask the real URLs contained in the body of your email.
- The subject of each message should be relevant to the body's content andshould not be misleading.
Delivery
- The following factors will help messages arrive in Gmail users' inboxes:
- The
Fromaddress is listed in the user's Contacts list. - A user clicks "Not Spam" to alert Gmail that messages sent from thataddress are solicited.
- The
- If you send both promotional email and transactional email relating to yourorganization, we recommend separating email by purpose as much as possible.You can do this by:
- Using separate email addresses for each function.
- Sending email from different domains for each function.
Third-party senders
- If others use your service to send email, you are responsible for monitoringyour 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. TheGoogleCloud Platform Acceptable Use Policy specifically prohibits spam.Your application can be suspended if you violate this policy, as described intheGoogle Cloud Platform Terms of Service.
- You must have an email address available for users and/or clients to reportabuse, which should normally be
abuse@[YOUR_DOMAIN].com. You should alsomonitorpostmaster@[YOUR_DOMAIN].com. - Monitor email sent to app admins. Google may need to urgently contact appadmins, 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 promptlyto our emails.
- You must maintain up-to-date contact information in your WHOIS recordmaintained by your domain registrar, and onabuse.net.
Affiliate marketing programs
- Affiliate marketing programs reward third-parties for bringing visitors toyour site. These programs are attractive to spammers and can potentially domore harm than good. Please note the following:
- If your brand becomes associated with affiliate marketing spam, it canaffect the email sent by you and your other affiliates.
- It is your responsibility to monitor your affiliates and remove them ifthey send spam.
Alternatives to the App Engine Mail API
- You can use a third-party email delivery service provider to send email fromApp Engine. These services may provide additional features that are notavailable in the Mail API and may be a better solution for some bulk emailsenders.
- You can use theSockets API to connect directly to an SMTPserver to send email.
Limits for bulk mail
If you send too many emails in a short burst, some emails might be silentlydropped due to Google safety limits. To avoid this, calculate the maximum dailyrate of emails sent per second by dividing your daily quota by 86,400, thenumber of seconds in a day. Do not send bulk email at a rate higher than 50times the maximum daily rate.
For more information on other quotas around sending mail, seeQuotas and limits.
What's next
- Read theMail API Overview.
- Learn how tosend mail with the Mail API.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-12-15 UTC.