Originally posted by tbach2
Wild guess...
text has \r\n
post example code, that might make it easier to figure out 😉
Yeah, you were right. 🙂 Thank you. Now, i simply do the following with the strings before sending it via email.
$emailtext1 = str_replace("\r\n", "\n", $row[1]);
But i have a similar problem i am again not able to solve. :rolleyes:
My emails consist of several text modules. Before i send them, i replace every occurance of "\r\n" with "\n" in all strings as shown above. Now i have the problem, that the first three text-modules are shown correctly in my plain text e-mails but the last one is shown totally without word-wraps.
How is this possible? I use same function on all strings but the last one is displayed without word wraps. If I display my strings in a textarea everything is all right.
Here is the code i use in the moment to build one type of e-mail:
function buildEmail($accountid, $emailType){
include_once("dbparam.php");
include_once("shippingfunctions.php");
//an db anmelden!
connectDB();
//*******************************************
//*** eMails zusammenbauen ***
//*******************************************
$result = mysql_query("SELECT subject, text1, text2, text3, text4, displayText FROM emails where emailtype = '".$emailType."'");
/* SQL-Abfrage */
$row = mysql_fetch_row($result); //Ausgabe Artikel
$emailtext1 = str_replace("\r\n", "\n", $row[1]);
$emailtext2 = str_replace("\r\n", "\n", $row[2]);
$emailtext3 = str_replace("\r\n", "\n", $row[3]);
$emailtext4 = str_replace("\r\n", "\n", $row[4]);
$displaytext = $row[5];
if($emailType== "std_confirm"){
$emailBody=$emailtext1;
$emailBody=$emailBody.makeItemtable_std($accountid);
$emailBody=$emailBody.makeReAdress($accountid);
$emailBody=$emailBody.makeLiAdress($accountid);
$emailBody=$emailBody.$emailtext2;
$sendSuccess=sendEmail($accountid, $row[0], $emailBody, false);
if($sendSuccess){
echo $displaytext;
}else{
echo "another fix text.";
};
}
return $sendSuccess;
}
Sorry i do not know how to copy tabs to make my code more readable...
Thank you in advance.
Ciao, BadMojo