Forum Moderators: coopster
I'm having a strange problem with the simple formatting of a plain text email message. As code below shows, I'm using 2 vars ($snl = "\n" and $dnl = "\n\n") to create single or double line breaks where I want them and generally speaking it works PERFECTLY.
Then I come to this one block where the line breaks suddenly DON'T work - all line breaks are ignored and everything flows to one continuous line... hummm.
I've tested and re-tested to no avail. Maybe someone can see where I'm going wrong.
The place where everything is going wrong is the case statement "case 'Bank Transfer':" - see below.
But that's the ONLY place where the line break formatting "doesn't stick"; even the lines AFTER this case statement are okay.
Neophyte
$snl = "\n";//Single new line character
$dnl = "\n\n";//Double new line characters
$body =
'**********************************************' . $snl .
'SEMINAR SPECIFICS' . $snl .
'**********************************************' . $dnl .
'Seminar Name: ' . $semTitle . $dnl .
'Seminar Venue: ' . $semVenue . $dnl .
'Seminar Dates: ' . $semDate . $dnl .
'**********************************************' . $snl .
'REGISTRANT SPECIFICS' . $snl .
'**********************************************' . $dnl .
'Name: ' . $regName . $dnl .
'Phone: ' . $regPhone . $dnl .
'Email: ' . $regEmail . $dnl .
'**********************************************' . $snl .
'COMPANY SPECIFICS' . $snl .
'**********************************************' . $dnl .
'Name: ' . $comName . $dnl .
'Address 1: ' . $comAdd1 . $dnl .
'Address 2: ' . $comAdd2 . $dnl .
'Town/City: ' . $comCity . $dnl .
'County/State: ' . $comState . $dnl .
'Postal: ' . $comPostal . $dnl .
'Country: ' . $comCountry . $dnl .
'VAT Num: ' . $comVat . $dnl .
'**********************************************' . $snl .
'DELEGATE SPECIFICS' . $snl .
'**********************************************' . $dnl .
'Number of Delegates: ' . $comDeleg . $dnl;
$delCount = count($del);
for($i=0; $i < $delCount; $i++)
{
$delArr = explode('¦', $del[$i]);
if($delCount > 1)
$body .= 'Delegate Number: ' . ($i + 1) . $snl;
$body .= 'Name: ' . $delArr[0] . $snl;
$body .= 'Position: ' . $delArr[1] . $snl;
$body .= 'Email: ' . $delArr[2] . $dnl;
}
$body .=
'**********************************************' . $snl .
'PAYMENT SPECIFICS' . $snl .
'**********************************************' . $dnl .
'Method of Payment: ' . $comPay . $dnl;
switch($comPay)
{
case 'Personal/Company Cheque':
$body .= 'Please make your personal or company cheque payable to: Some Company' . $dnl;
$body .= 'You may remit your payment in person, by curior, or by post to:' .$snl;
$body .= 'Some Company' . $snl;
$body .= 'Some Address' . $snl;
$body .= 'Some City and Country' . $snl;
$body .= 'Some Phone Number' . $dnl;
break;
case 'Bank Transfer':
$body .= 'Bank Transfer Specifics and Instructions:' . $dnl;
$body .= 'Some Bank' . $snl;
$body .= 'Some Bank Address' . $snl;
$body .= 'Some City and Country' . $snl;
$body .= 'Bank Sort Code: Some Sort Code' . $snl;
$body .= 'IBAN Code: Some Iban Number' . $snl;
$body .= 'Account Number: Some Account Number' . $dnl;
$body .= 'When remitting your payment via bank transfer please quote the names' . $snl;
$body .= 'of your delegates along with our invoice number.' . $dnl;
break;
}
$body .=
'**********************************************' . $snl .
'REGISTRATION SENT' . $snl .
'**********************************************' . $dnl .
$body = wordwrap($body, 70);
$emailType = 'Text';
$attachments = FALSE;
$result = send_mail($toName, $toAdd, $fromName, $fromAdd, $subject, $body, $emailType, $attachments);
if(!$result) echo 'Attention: Email Error';