Send email activity (Office 365 API) fails when number of attachments above certain limit

Hello,

Using Microsoft Office 365 API outlook activity to send a single email with multiple invoice attachments. The bot fails when the number of attachments were 100+. The exception was as below :-

Status Code: 0
Microsoft.Graph.ServiceException: Code: generalException
Message: An error occurred sending the request.
—> System.ArgumentException: The base stream is not readable.
Parameter name: stream
at System.IO.Compression.DeflateStream…ctor(Stream stream, Boolean leaveOpen, IFileFormatReader reader)
at System.IO.Compression.GZipStream…ctor(Stream stream, CompressionMode mode, Boolean leaveOpen)
at System.IO.Compression.GZipStream…ctor(Stream stream, CompressionMode mode)
at Microsoft.Graph.CompressionHandler.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Graph.AuthenticationHandler.d__16.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)

Is there a limit to the number of attachments to a single emial using office 365 API call? The total size of all the attachments was less than 5MB.
I ran the bot by reducing the nmber of attachments to 50 and it was successful.
CAn someone help with this?
Thanks in advance.

Hi @Vaishampayan_Aditi,

Please make a zip and attach the documnets.

Regards,
Pavan Kumar

1 Like

Hi @Vaishampayan_Aditi

There is a limit to the number and size of attachments that can be included in an email sent using the Office 365 API.

According to Microsoft’s documentation, the maximum number of attachments that can be included in a single email is 250, and the maximum size of all attachments combined is 25 MB.

It looks like you are encountering an error when trying to send an email with more than 100 attachments, which suggests that you may be exceeding one of these limits.

You may want to try reducing the number of attachments or the size of the attachments to see if that resolves the issue.

Regards,
Kaviyarasu N

@Kaviyarasu_N thanks for the info.
In one run there were 170 attachments with 7.5MB size and another one was with 102 attachments with 7.01MB. So both within the limits.
So is there a setting at outlook level then for the allowable limit?

Hi @Vaishampayan_Aditi
Refer below youtube link

Regards
Kaviyarasu N

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.