I am trying to send my users a mail using php but keep getting the following error on my mail server.
550 Maximum line length exceeded
I figure the problem is that the body is all 1 line so I tried adding both a php line break "/n" as carriage return and line feed "%0D%0A" to each line, but I keep getting the same error.
Here is the relevant code:
$mailtemplate = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">';
$mailtemplate .= '<html style="width:100%;margin:0;padding:0;">';
$mailtemplate .= '<head>';
$mailtemplate .= '<meta http-equiv="content-type" content="text/html;charset=utf-8">';
$mailtemplate .= '<title>Mail</title>';
$mailtemplate .= '</head>';
$mailtemplate .= '<body style="width:100%;font-family:Century Gothic,Verdana,Helvetica,sans-serif;margin:0;padding:0;">';
$mailtemplate .= '<div class="container" style="margin:0;padding:0;max-width:600px;margin-left:auto;margin-right:auto;border:2px solid #e6e6e6;margin-top:15px;border-radius:2px;">';
$mailtemplate .= '<div class="header-container" style="text-align:center;background-color:#000000;">';
$mailtemplate .= '<div class="header" style="padding:25px;">';
$mailtemplate .= 'header';
$mailtemplate .= '</div>';
$mailtemplate .= '</div>';
$mailtemplate .= '<div class="content-container" style="border-top:2px solid #e6e6e6;border-bottom:2px solid #e6e6e6;text-align:left;">';
$mailtemplate .= '<div class="content" style="padding:15px;">';
$mailtemplate .= 'content';
$mailtemplate .= '</div>';
$mailtemplate .= '</div>';
$mailtemplate .= '<div class="footer-container" style="background-color:#fafafa;color:#525252;font-size:12px;line-height:18px;">';
$mailtemplate .= '<div class="footer" style="padding:15px;">';
$mailtemplate .= '<div class="footer-left" style="width:50%;float:left">';
$mailtemplate .= 'footer';
$mailtemplate .= '</div>';
$mailtemplate .= '</div>';
$mailtemplate .= '</div>';
$mailtemplate .= '</div>';
$mailtemplate .= '</body>';
$mailtemplate .= '</html>';
//echo $body;
$result = mail('recipient@email.com', 'Hello', $mailtemplate , "From: info@email.com");