Page 1 of 1

PHP Mail Message Length Problem

Posted: Sat Apr 23, 2011 12:39 pm
by PARL
I am having difficulty sending an e-mail using the PHP mail function with a message length exceeding 10,000 characters. A message with a length of 10,000 characters works, but one with a length of 20,000 characters doesn’t. I have checked with my Web Host Provider, 1and1 Internet, and have been told that they place no limit on the length of e-mails sent.

Any ideas please?

Re: PHP Mail Message Length Problem

Posted: Sat Apr 23, 2011 1:19 pm
by fugix
the only restraint that i know of for the mail() function is that lines should be no longer than 70 chraracters

Re: PHP Mail Message Length Problem

Posted: Sat Apr 23, 2011 4:10 pm
by getmizanur
Far as I know there is no restriction on number character allowed by mail server however there may be limit on number of characters per line. Have you tried adding '\r\n' at the end of each line

Code: Select all

$html = "<html>";
$html .= "<p>long string</p>\r\n";
$html .= "<p>another long string</p>\r\n";
$html .= "</html>"

$to = "blah@blah.com";
$subject = "blah..."

mail($to, $subject, $html);