PHP Mail Message Length Problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PARL
Forum Newbie
Posts: 1
Joined: Sat Apr 23, 2011 12:32 pm

PHP Mail Message Length Problem

Post 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?
fugix
Forum Contributor
Posts: 207
Joined: Fri Mar 18, 2011 8:01 pm

Re: PHP Mail Message Length Problem

Post by fugix »

the only restraint that i know of for the mail() function is that lines should be no longer than 70 chraracters
User avatar
getmizanur
Forum Commoner
Posts: 71
Joined: Sun Sep 06, 2009 12:28 pm

Re: PHP Mail Message Length Problem

Post 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);
Post Reply