Memon Posted January 31, 2010 Share Posted January 31, 2010 Hello All I am using a button in my script to send the email. It sends the email, but I can not set multiple lines in email body. My script is like this; $sub="Order for Item No:".$item_no; $body = $sub."./n Name: /n Tel No:"; echo "<input type='button' value='Order This Item' onClick=\"parent.location='mailto:[email protected]?subject=$sub&body=$body'\">"; I want "Item No" , "Name" & "Tel No" in separate lines in the mail body, but it all comes in a single line. Can someone guide me. Link to comment https://forums.phpfreaks.com/topic/190432-new-line-line-feed-in-php/ Share on other sites More sharing options...
mikesta707 Posted January 31, 2010 Share Posted January 31, 2010 try using \r\n instead of just \n Link to comment https://forums.phpfreaks.com/topic/190432-new-line-line-feed-in-php/#findComment-1004522 Share on other sites More sharing options...
Memon Posted January 31, 2010 Author Share Posted January 31, 2010 try using \r\n instead of just \n Thanks. I hv already tried it. Whether "\n" or "\r\n", in both cases browser gives error & mailclient does not popup. When removing this part, mail comes up, but body in single line. Link to comment https://forums.phpfreaks.com/topic/190432-new-line-line-feed-in-php/#findComment-1004524 Share on other sites More sharing options...
Memon Posted January 31, 2010 Author Share Posted January 31, 2010 Problem solved by using "%0A" instead of "\n" or "\r\n". Thanks all. Link to comment https://forums.phpfreaks.com/topic/190432-new-line-line-feed-in-php/#findComment-1004600 Share on other sites More sharing options...
eharpaz Posted January 31, 2010 Share Posted January 31, 2010 Memon I am having the same problem on my submit information to email script. I have 4 lines of information as seen below ($name, $customer_mail, $phone, $location). how would I make those show up on seperate lines? mail( "[email protected]", "Contact Form Results", $emailMessage, "$name, $customer_mail, $phone, $location" ); Link to comment https://forums.phpfreaks.com/topic/190432-new-line-line-feed-in-php/#findComment-1004601 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.