Is there any limit in PHP post?
Posted July 17th 2013, 2:59am
I have a submit form
<?php
$email = $_POST["email"];
$to = 'myEmail@gmail.com' . ', ';
$subject = "Submitform";
$message = $_POST["myHTML"];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
if(mail($to, $subject, $message, $headers))
{
echo "send OK"; }
else{
echo "not send";
}
?>

"myHTML" is a text input where contains a HTML code, around 5000 chars.
The problem is that when received in email source code, HTML code is divided into some small groups (in the same length, around 1200 chars) by inserted some 'line-feed'.
Any one has experience in this situation? How can I repair the problem?
φ
Posts: 35
Joined: May 23rd 2013, 9:51pm
Likes Received: 1
Is there any limit in PHP post?
Posted July 17th 2013, 12:07pm
The PHP mail() function has limitations on line length. If you want to send emails which contain no line breaks, use SMTP instead. Here are two libraries which make it easy to use SMTP:

http://pear.php.net/package/Mail/
http://code.google.com/a/apache-extras. ... ulTutorial
φ
Posts: 1599
Joined: March 12th 2009, 11:00pm
Location: Uncertain due to momentum
Likes Given: 26
Likes Received: 357

Who is online

Users browsing this forum: No registered users and 1 guest