简体   繁体   English

SendGrid邮件发送API,SendGrid支持哪些类型的邮件附件

[英]SendGrid emailing API , which types of email attachment supported by SendGrid

I'm using next code for send email attachments:我正在使用下一个代码发送电子邮件附件:

Attachments attachments3 = new Attachments();
Base64 x = new Base64();
String imageDataString = x.encodeAsString(fileData);
attachments3.setContent(imageDataString);
attachments3.setType("image/png");//"application/pdf"
attachments3.setFilename("x.png");
attachments3.setDisposition("attachment");
attachments3.setContentId("Banner");
mail.addAttachments(attachments3);

Here there is setter setType.这里有setter setType。

Do SendGrid have white list for type of attachment? SendGrid 是否有附件类型的白名单?

For example i can't send.exe or.rar files in another services.例如,我无法在其他服务中发送 .exe 或 .rar 文件。 I want know prohibitions for SendGrid.我想知道 SendGrid 的禁令。

According to their documentation the only limit is 30MB or less.根据他们的文档,唯一的限制是 30MB 或更少。

https://docs.sendgrid.com/api-reference/mail-send/limitations https://docs.sendgrid.com/api-reference/mail-send/limitations

From having used SendGrid in the past, I would be surprised if they limit what file types you can send.从过去使用 SendGrid 开始,如果他们限制您可以发送的文件类型,我会感到惊讶。

Just a small precision: The total size of your email, including attachments, must be less than 30MB.只是一个小的精确度:您的电子邮件的总大小(包括附件)必须小于 30MB。

Their recommendation is not to exceed 10MB他们的建议是不要超过 10MB

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM