Mail with headers or attachments Stay organized with collections Save and categorize content based on your preferences.
When you send mail using theMail API,there are some restrictions on the headers that you can use and the types offiles you can attach.
Optional headers
An outgoing email has headers that provide details about the message, such asthe sender, recipient, date, and subject. Each header has a name and a value.You can also include the following headers in an outgoing email; for securitypurposes, other headers are not allowed:
- In-Reply-To
- List-Id
- List-Unsubscribe
- On-Behalf-Of
- References
- Resent-Date
- Resent-From
- Resent-To
Mail with attachments
An outgoing email message can have file attachments. Each attachment has afilename and file data. The file data can come from any source, such as anapplication data file or the datastore.
Filename extensions that are prohibited
As a security measure to protect against viruses, email attachments cannot usethe following filename extensions, and ZIP files cannot contain files with thefollowing filename extensions:
- ade
- adp
- bat
- chm
- cmd
- com
- cpl
- exe
- hta
- ins
- isp
- jse
- lib
- mde
- msc
- msp
- mst
- pif
- scr
- sct
- shb
- sys
- vb
- vbe
- vbs
- vxd
- wsc
- wsf
- wsh
Attachments and Multipurpose Internet Mail Extensions (MIME) types
The MIME type of an attachment is determined from the file's extension. The MIMEtype identifies the type of content that is being sent, and can determine howthat data is transferred.
The following is a list of MIME types and their corresponding filenameextensions. You are not limited to these extensions, but if you use an unknownextension, App Engine will assign it the MIME typeapplication/octet-stream.
| MIME type | Filename extensions |
|---|---|
| application/msword | doc, docx |
| application/pdf | |
| application/rss+xml | rss |
| application/vnd.google-earth.kml+xml | kml |
| application/vnd.google-earth.kmz | kmz |
| application/vnd.ms-excel | xls, xlsx |
| application/vnd.ms-powerpoint | pps, ppt, pptx |
| application/vnd.oasis.opendocument.presentation | odp |
| application/vnd.oasis.opendocument.spreadsheet | ods |
| application/vnd.oasis.opendocument.text | odt |
| application/vnd.sun.xml.calc | sxc |
| application/vnd.sun.xml.writer | sxw |
| application/x-gzip | gzip |
| application/zip | zip |
| audio/basic | au snd |
| audio/flac | flac |
| audio/mid | mid, rmi |
| audio/mp4 | m4a |
| audio/mpeg | mp3 |
| audio/ogg | oga, ogg |
| audio/x-aiff | aif, aifc, aiff |
| audio/x-wav | wav |
| image/gif | gif |
| image/jpeg | jpeg, jpg, jpe |
| image/png | png |
| image/tiff | tiff, tif |
| image/vnd.wap.wbmp | wbmp |
| image/x-ms-bmp | bmp |
| text/calendar | ics |
| text/comma-separated-values | csv |
| text/css | css |
| text/html | htm, html |
| text/plain | asc, c, diff, log, patch, pot, text, txt |
| text/x-vcard | vcf |
| video/mp4 | mp4 |
| video/mpeg | mpeg, mpg, mpe |
| video/ogg | ogv |
| video/quicktime | qt, mov |
| video/x-msvideo | avi |
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.