0

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.

Do SendGrid have white list for type of attachment?

For example i can't send .exe or .rar files in another services. I want know prohibitions for SendGrid.

2 Answers 2

1
Answer recommended by Twilio Collective

According to their documentation the only limit is 30MB or less.

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.

1
  • 1
    It is probably also worth considering that inboxes may be less likely to happily receive emails containing .exe or .rar file attachments and may block them. So, even if SendGrid is happy sending them, you might find your email blocked on the recipient side.
    – philnash
    Commented Feb 10, 2022 at 23:38
0

Just a small precision: The total size of your email, including attachments, must be less than 30MB.

Their recommendation is not to exceed 10MB

Not the answer you're looking for? Browse other questions tagged or ask your own question.