Re: [PHP] \n problems when creating an email
If the recipient is gmail, then you need to use \r\n because Gmail is following in the Windows way of ignoring standards... :-( On Mon, February 11, 2008 6:10 am, Angelo Zanetti wrote: Hi guys, I am making email text based on some fields the user fills in and then email the admin the details. I am having a problem where sometimes the \n (new line) works and sometimes it just does nothing. Im not sure the cause but I cant seem to figure it out. Here is a segment of code: .\nHow far would they be prepared to travel to .\n event venue? \n\t\t\t\t\t. $travel .\nDo you have a specific location . \n of preference? \n\t\t\t\t\t. $locationPref .\n City or country preference:\t. $cityPref Here is the output: How far would they be prepared to travel to event venue? Z Logic e Business Cape Do you have a specific location of preference? Z Logic e Business Cape City or country preference: Z Logic e Business Cape As you can see the first line doesn't go to the next row before event But it works fine for the location \n preference Is there any reason it works for the 1 piece of code and not the next? Do spaces affect anything? Kind regards, Angelo Zanetti Application Developer Telephone: +27 (021) 552 9799 Mobile: +27 (0) 72 441 3355 Fax:+27 (0) 86 681 5885 Web: http://www.elemental.co.za E-Mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] \n problems when creating an email
I've found it to be a lost cause to add pure white space in tabs during emails. Most clients are helpful in making things user friendly by removing leading white space. What i found did work on most machines at the time was either just a newline or a Q: question\nA: answer\n which isn't as formatted, but does the readabilty job. Wolf -Original Message- From: Angelo Zanetti [EMAIL PROTECTED] Sent: Monday, February 11, 2008 7:23 AM To: 'Stut' [EMAIL PROTECTED] Cc: php-general@lists.php.net Subject: RE: [PHP] \n problems when creating an email Looks like you're using Outlook. It has an annoying feature where it helpfully removes extra line breaks. This would appear to be what's happening here. When it does this it usually displays a notice somewhere to say it's done this and offers a way to undo it. Thanks, dam I been wasting my time trying to figure out the solution... However I see that with the tabbed (\t) formatting its very inconsistent in many email and web clients... Do you have a solution to ensure that the output is consistent always? Please send some links or any advice, TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] \n problems when creating an email
exactly as stut said, try using double /n's or convert the email to html. whilst testing always view email source to verify what your creating. Nath Stut wrote: Angelo Zanetti wrote: I am making email text based on some fields the user fills in and then email the admin the details. I am having a problem where sometimes the \n (new line) works and sometimes it just does nothing. Im not sure the cause but I cant seem to figure it out. Looks like you're using Outlook. It has an annoying feature where it helpfully removes extra line breaks. This would appear to be what's happening here. When it does this it usually displays a notice somewhere to say it's done this and offers a way to undo it. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] \n problems when creating an email
Angelo Zanetti wrote: I am making email text based on some fields the user fills in and then email the admin the details. I am having a problem where sometimes the \n (new line) works and sometimes it just does nothing. Im not sure the cause but I cant seem to figure it out. Looks like you're using Outlook. It has an annoying feature where it helpfully removes extra line breaks. This would appear to be what's happening here. When it does this it usually displays a notice somewhere to say it's done this and offers a way to undo it. -Stut -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] \n problems when creating an email
On Feb 11, 2008 7:10 AM, Angelo Zanetti [EMAIL PROTECTED] wrote: Hi guys, I am making email text based on some fields the user fills in and then email the admin the details. I am having a problem where sometimes the \n (new line) works and sometimes it just does nothing. Im not sure the cause but I cant seem to figure it out. Try using HEREDOC syntax instead: $message =EOM How far would they be prepared to travel to event venue? $travel Do you have a specific location of preference? $locationPref City or country preference:$cityPref EOM; It may not prevent the client from reformatting the message on delivery, as Stut, Nathan, and Wolf already correctly mentioned, but placing it in a HEREDOC will improve readability, send an exact structure without need for interpretation (of newlines-vs-carriage-return-newlines and number of spaces per tab), and allow you to freely use quotes without having to remember to escape them (or escape to insert a variable). -- /Dan Daniel P. Brown Senior Unix Geek ? while(1) { $me = $mind--; sleep(86400); } ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] \n problems when creating an email
Looks like you're using Outlook. It has an annoying feature where it helpfully removes extra line breaks. This would appear to be what's happening here. When it does this it usually displays a notice somewhere to say it's done this and offers a way to undo it. Thanks, dam I been wasting my time trying to figure out the solution... However I see that with the tabbed (\t) formatting its very inconsistent in many email and web clients... Do you have a solution to ensure that the output is consistent always? Please send some links or any advice, TIA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php