Abhay Anand
Abhay Anand

Reputation: 602

Amazon SES: Message sending failed - The following SMTP error was encountered: 552 5.3.4 Message is too long

I was send mail with 7MB attachment file then I got below error. How can I solve it?

220 email-smtp.amazonaws.com ESMTP SimpleEmailService-d-8ND3U1R22 5Eg0poz3kAZNziS4R0Qn
hello: 250-email-smtp.amazonaws.com
250-8BITMIME
250-SIZE 10485760
250-STARTTLS
250-AUTH PLAIN LOGIN
250 Ok
starttls: 220 Ready to start TLS
hello: 250-email-smtp.amazonaws.com
250-8BITMIME
250-SIZE 10485760
250-STARTTLS
250-AUTH PLAIN LOGIN
250 Ok
from: 250 Ok
to: 250 Ok
data: 354 End data with .
552 5.3.4 Message is too long.
The following SMTP error was encountered: 552 5.3.4 Message is too long.
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

Upvotes: 7

Views: 9988

Answers (3)

Jaap van der Herberg
Jaap van der Herberg

Reputation: 177

When sending e-mail via AWS SES there are currently 2 numbers to keep in mind for message size: 10mB and 40mB. There's a quota for maximum message size and there may be bandwidth throttling.

The documentation for AWS SES limits is located at https://docs.aws.amazon.com/ses/latest/DeveloperGuide/quotas.html (Service quotas in Amazon SES):

Resource: Using the SES v2 API or SMTP - Maximum message size (including attachments)
Default Quota: 40 MB per message (after base64 encoding).
Eligible for Increase?: No

(Until September 2021, this quota was at 10MB).

If your e-mail message exceeds this quota, you will see the response 552 5.3.4 Message is too long. (This is documented in the AWS SES list of SMTP response codes).

Messages larger than 10MB are subject to bandwidth throttling, and depending on your sending rate, you may be throttled to as low as 40MB/s. For example, you could send a 40MB message at the rate of 1 message per second, or two 20MB messages per second.

Upvotes: 5

i_am_pimy
i_am_pimy

Reputation: 31

As of Sep 2021, they support a max message size limit of 40 MB.

https://aws.amazon.com/about-aws/whats-new/2021/09/amazon-ses-emails-message-40mb/

Upvotes: 3

Farhan
Farhan

Reputation: 253

Amazon SES have the message length limit i.e. 10 MB, that cannot be increase. Also, your base64 encoding version of message may exceeds the limit, so caused the error. I think you can include a link within the same email to a URL pointing to the file that can be downloaded by navigating it.

Upvotes: 1

Related Questions