Correos con encabezados o archivos adjuntos
Organiza tus páginas con colecciones
Guarda y categoriza el contenido según tus preferencias.
Cuando envías correos con la API de correo, hay algunas restricciones en los encabezados que puedes usar y los tipos de archivos que puedes adjuntar.
Un correo electrónico saliente tiene encabezados que proporcionan detalles sobre el mensaje, como el remitente, el destinatario, la fecha y el asunto. Cada encabezado tiene un nombre y un valor.
También puedes incluir los siguientes encabezados en un correo electrónico saliente. Por motivos de seguridad, no se permite usar otros:
- In-Reply-To
- List-Id
- List-Unsubscribe
- On-Behalf-Of
- Referencias
- Resent-Date
- Resent-From
- Resent-To
Correo con archivos adjuntos
Un mensaje de correo electrónico saliente puede tener archivos adjuntos. Cada adjunto tiene un nombre de archivo y datos de archivo. Los datos de archivo pueden provenir de cualquier fuente, como un archivo de datos de la aplicación o el almacén de datos.
Extensiones de nombre de archivo prohibidas
Como medida de seguridad para evitar la propagación de virus, los archivos adjuntos de correo electrónico no pueden usar las siguientes extensiones de nombre de archivo y los archivos ZIP no pueden contener archivos con las siguientes extensiones de nombre de archivo:
- ade
- adp
- murciélago
- 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
Archivos adjuntos y tipos de extensiones multipropósito de correo de Internet (MIME)
El tipo de MIME de un archivo adjunto se determina a partir de su extensión. El tipo de MIME identifica el tipo de contenido que se está enviando y puede determinar cómo se transfieren esos datos.
La siguiente es una lista de tipos de MIME y sus correspondientes extensiones de nombre de archivo. No estás limitado a usar estas extensiones, pero si usas una extensión desconocida, App Engine asignará el tipo application/octet-stream
de MIME.
Tipo de MIME |
Extensiones de nombre de archivo |
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 |
Salvo que se indique lo contrario, el contenido de esta página está sujeto a la licencia Atribución 4.0 de Creative Commons, y los ejemplos de código están sujetos a la licencia Apache 2.0. Para obtener más información, consulta las políticas del sitio de Google Developers. Java es una marca registrada de Oracle o sus afiliados.
Última actualización: 2025-09-04 (UTC)
[[["Fácil de comprender","easyToUnderstand","thumb-up"],["Resolvió mi problema","solvedMyProblem","thumb-up"],["Otro","otherUp","thumb-up"]],[["Difícil de entender","hardToUnderstand","thumb-down"],["Información o código de muestra incorrectos","incorrectInformationOrSampleCode","thumb-down"],["Faltan la información o los ejemplos que necesito","missingTheInformationSamplesINeed","thumb-down"],["Problema de traducción","translationIssue","thumb-down"],["Otro","otherDown","thumb-down"]],["Última actualización: 2025-09-04 (UTC)"],[[["\u003cp\u003eWhen using the Mail API, there are specific limitations on the headers you can include, with only a defined list of headers being permitted for security reasons.\u003c/p\u003e\n"],["\u003cp\u003eOutgoing emails can include file attachments, with the file data potentially coming from various sources within your application.\u003c/p\u003e\n"],["\u003cp\u003eCertain file extensions are prohibited for email attachments and within ZIP files due to security risks, including extensions like \u003ccode\u003e.exe\u003c/code\u003e, \u003ccode\u003e.bat\u003c/code\u003e, and \u003ccode\u003e.vbs\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe MIME type of an email attachment is determined by its file extension, and while many common extensions are recognized, unknown extensions are defaulted to \u003ccode\u003eapplication/octet-stream\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe provided content lists the supported MIME types and their corresponding file extensions, giving a clear guide to users.\u003c/p\u003e\n"]]],[],null,["# Mail with Headers or Attachments\n\nWhen you send mail using the [Mail API](/appengine/docs/legacy/standard/php/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| php-gen2\n|\n| /services/access). If you are updating to the App Engine PHP 7/8 runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/php-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`."]]