E-Mail mit Headern oder Anhängen
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Wenn Sie mit der Mail API E-Mails senden, gelten einige Einschränkungen für die Header, die Sie verwenden können, und die Dateitypen, die als Anhang zulässig sind.
Eine ausgehende E-Mail enthält Header mit Details zur Nachricht wie Absender, Empfänger, Datum und Betreff. Jeder Header hat einen Namen und einen Wert.
Sie können auch die folgenden Header in eine ausgehende E-Mail einfügen (aus Sicherheitsgründen sind andere Header nicht erlaubt):
- In-Reply-To
- List-Id
- List-Unsubscribe
- On-Behalf-Of
- Verweise
- Resent-Date
- Resent-From
- Resent-To
E-Mail mit Anhängen
Eine ausgehende E-Mail-Nachricht kann Dateianhänge enthalten. Jeder Anhang hat einen Dateinamen und enthält Dateidaten. Die Dateidaten können aus einer beliebigen Quelle stammen, z. B. einer Anwendungsdatendatei oder dem Datenspeicher.
Unzulässige Dateinamenerweiterungen
Als Sicherheitsmaßnahme zum Schutz vor Viren dürfen E-Mail-Anhänge die folgenden Dateinamenerweiterungen nicht verwenden. Auch ZIP-Dateien dürfen keine Dateien mit den folgenden Dateinamenerweiterungen enthalten:
- ADE
- ADP
- Fledermaus
- 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
Anhänge und MIME-Typen (Multipurpose Internet Mail Extensions)
Der MIME-Typ eines Anhangs wird anhand der Dateierweiterung ermittelt. Der MIME-Typ kennzeichnet den Typ des gesendeten Inhalts und kann bestimmen, wie diese Daten übertragen werden.
Im Folgenden finden Sie eine Liste der MIME-Typen und ihrer entsprechenden Dateinamenerweiterungen. Sie sind nicht auf diese Erweiterungen beschränkt, aber wenn Sie eine unbekannte Erweiterung verwenden, weist App Engine ihr den MIME-Typ application/octet-stream
zu.
MIME-Typ |
Dateinamenerweiterungen |
application/msword |
DOC, DOCX |
application/pdf |
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 |
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-09-04 (UTC).
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Schwer verständlich","hardToUnderstand","thumb-down"],["Informationen oder Beispielcode falsch","incorrectInformationOrSampleCode","thumb-down"],["Benötigte Informationen/Beispiele nicht gefunden","missingTheInformationSamplesINeed","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-09-04 (UTC)."],[[["\u003cp\u003eThe Mail API for first-generation runtimes has specific restrictions on allowable headers and attachment types when sending emails, and it can be used while upgrading to corresponding second-generation runtimes.\u003c/p\u003e\n"],["\u003cp\u003eOnly a predefined list of email headers, including In-Reply-To, List-Id, and Resent-From, are allowed for use in outgoing emails for security reasons.\u003c/p\u003e\n"],["\u003cp\u003eFile attachments are permitted in outgoing emails, but certain file extensions, such as .exe, .bat, and .vbs, are strictly prohibited to protect against viruses, and this extends to files contained within ZIP archives.\u003c/p\u003e\n"],["\u003cp\u003eThe MIME type of a file attachment is determined by its file extension, and while you can use extensions not in the defined list, those will default to the \u003ccode\u003eapplication/octet-stream\u003c/code\u003e MIME type.\u003c/p\u003e\n"],["\u003cp\u003eA table is provided that lists the compatible Mime types and the file extensions that correspond to each of them, including image, video, audio, text, and other general application types.\u003c/p\u003e\n"]]],[],null,["# Mail with Headers or Attachments\n\nWhen you send mail using the [Mail API](/appengine/docs/legacy/standard/go111/mail),\nthere are some restrictions on the headers that you can use and the types of\nfiles you can attach.\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\nOptional headers you can use\n----------------------------\n\nAn outgoing email has headers that provide details about the message, such as\nthe sender, recipient, date, and subject. Each header has a name and a value.\nYou can also include the following headers in an outgoing email; for security\npurposes, other headers are not allowed:\n\n- In-Reply-To\n- List-Id\n- List-Unsubscribe\n- On-Behalf-Of\n- References\n- Resent-Date\n- Resent-From\n- Resent-To\n\nMail with attachments\n---------------------\n\nAn outgoing email message can have file attachments. Each attachment has a\nfilename and file data. The file data can come from any source, such as an\napplication data file or the datastore.\n\n### Filename extensions that are prohibited\n\nAs a security measure to protect against viruses, email attachments cannot use\nthe following filename extensions, and ZIP files cannot contain files with the\nfollowing filename extensions:\n\n- ade\n- adp\n- bat\n- chm\n- cmd\n- com\n- cpl\n- exe\n- hta\n- ins\n- isp\n- jse\n- lib\n- mde\n- msc\n- msp\n- mst\n- pif\n- scr\n- sct\n- shb\n- sys\n- vb\n- vbe\n- vbs\n- vxd\n- wsc\n- wsf\n- wsh\n\n### Attachments and Multipurpose Internet Mail Extensions (MIME) types\n\nThe MIME type of an attachment is determined from the file's extension. The MIME\ntype identifies the type of content that is being sent, and can determine how\nthat data is transferred.\n\nThe following is a list of MIME types and their corresponding filename\nextensions. You are not limited to these extensions, but if you use an unknown\nextension, App Engine will assign it the MIME type `application/octet-stream`."]]