I’m having trouble sending emails with big file attachments in my Laravel app.
When I try to send an email with a 75MB file attached through my Laravel application, I get this error message:
{ "message": "Client error: `POST https://api.mailgun.net/v3/mg.example.com/messages.mime` resulted in a `413 Request Entity Too Large`}
I already tried changing these PHP settings but nothing worked:
upload_max_filesize
post_max_size
LimitRequestBody
The error keeps showing up no matter what I do. Has anyone dealt with this before? What’s the best way to handle sending large attachments through email in Laravel?
I’d also love some tips on managing big files in email systems in general. Should I be doing something different?
yeah, 413 is from Mailgun’s end. they limit sizes to about 25-50MB. better to upload the file to something like dropbox or s3 and just share the link. way easier than fighting with email attachments!
This happens with pretty much every email provider, not just Mailgun. They all have strict attachment limits no matter what your server settings are. Hit the same wall last year building a document system. That 413 error means Mailgun bounced your message - their limit’s around 25MB for the entire message including attachments. Your PHP config won’t fix this since it’s Mailgun blocking it, not your server. Here’s what I did: files under 10MB get attached normally, anything bigger goes to S3 first and I send a download link instead (with expiration). Bonus - delivery rates actually improved since big attachments trip spam filters anyway.