Fizzix
Fizzix

Reputation: 24375

Why does sending a large string with PHP mail() time out?

I am attempting to send a very large string (a base64 encoded string) with PHP mail().

The smallest the string will be is around 350kb, and it could go all the way up to around 2mb.

I am sending the string as a data image for the receiver to view in the HTML email, like so:

<img src=" . $dataImg . " />

When I attempt to submit the contact form with the string in a hidden field, it seems to timeout and do absolutely nothing. Although when I send the form without the string in the hidden field, the form submits perfectly fine and I receive the email with an empty img tag.

I have tried testing my string within other environments to see if it renders an image correctly, and it does. So there is definitely no problem with the image.

Is there an option within php.ini that needs to be changed to up the limit on how much data can be sent with PHP mail()?


EDIT:

After pressing the submit button on my form, approximately 10 seconds later the following error is displayed in my console.

POST http://website.com/submit-quote/ 413 (Request Entity Too Large) 

Upvotes: 0

Views: 168

Answers (1)

vaso123
vaso123

Reputation: 12391

Ok, so check what is the post_max_size settings in your php.ini, try to incrase it, and restart webserver.

Upvotes: 1

Related Questions