This topic is locked

Insert Carriage Return In Email Data Option

3/19/2013 12:51:39 PM
PHPRunner General questions
H
hdpittman author

Existing code just 'blobs' all fields and data in a line. What Shows in Email: (New Rule Change Request Has Been Entered for the Committee to review ---- Date of Request : 2013-03-19 Submitted by: : Henry D Type of Request : New Rule Rule Number to Amend : 5.9.22 Currently Reads : This rule currently reads this blah and blah Proposed Change : This rule should change to lkjlkjljk ljlaskjflsdkjfsd laskjdfakldjsflsdkj lakjdflasdkjf alsdkjfalsdkfjasdfjksdklj
Current "CLOSED" fix says to change /b/r to
that doesn't fix it.
What is the fix to turn the code below to something that will look like this:

Field1: Data1

Field2: Data2

Field3: Data3 (and so on)
$msg="New Rule Change Request Has Been Entered for the Committee to review ----

";

$subject="--rbegin--New data record Entered into Database--rend--";
global $pageObject;
foreach($values as $field=>$value)

{

if(!IsBinaryType($pageObject->pSet->getFieldType($field)))

$msg.= $field." : ".$value."\r\n";

}
$ret=runner_mail(array('to' => $email, 'subject' => $subject, 'body' => $msg, 'from'=>$from));

if(!$ret["mailed"])

echo $ret["message"];
Please Keep your answer simple - as I am simple user <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=20803&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />

Sergey Kornilov admin 3/19/2013

Unfortunately this question doesn't make much sense int he way it's asked because all formatting is off.
Probably you can post a couple screenshots that explain this issue.

H
hdpittman author 3/20/2013



Unfortunately this question doesn't make much sense int he way it's asked because all formatting is off.
Probably you can post a couple screenshots that explain this issue.



ok, Well not exactly sure what you mean by all formatting is off... BUT here is something I found that might clarify? I hope it does.
I changed the Code to this:

foreach($values as $field=>$value)

{

if(!IsBinaryType($pageObject->pSet->getFieldType($field)))

$msg.= $field." : ".$value.PHP_EOL;

}



adding the PHP_EOL

And then I noticed - _Microsoft Outlook had removed 'Extra Line Breaks'_so it appears my issue all along might have been caused by Outlook where there is an option in settings to remove this feature of 'remove extra line breaks'
Is there anything we can do in php - that would ignore Outlooks feature for people who don't have that turned off??
If this reply again has "No formatting" please explain what "Formatting is off" means.

Sergey Kornilov admin 3/20/2013

If your issue is related to Outlook eating line ends - you need to switch to HTML email and use
as a new line delimiter. Probably that can help.