MDanz Posted September 1, 2010 Share Posted September 1, 2010 when i send this to my email.... the line breaks are all wrong. I want user1, user2 and user3 directly underneath each other. instead they are one line beneath and moved over to the right. What's the correct way to do line breaks for email? $to = $key; $subject = "subject"; $headers = "From: $email"; $server = "http://www.example.com"; ini_set("SMTP",$server); $body=" user1\r user2\r user3\r "; mail($to, $subject, $body, $headers); Quote Link to comment https://forums.phpfreaks.com/topic/212262-line-break-help/ Share on other sites More sharing options...
Zane Posted September 1, 2010 Share Posted September 1, 2010 try using an actual newline character.. along or without your carriage return. In other words. \r\n instead of \r Quote Link to comment https://forums.phpfreaks.com/topic/212262-line-break-help/#findComment-1106008 Share on other sites More sharing options...
haku Posted September 1, 2010 Share Posted September 1, 2010 If you are creating the mail in PHP, you can use PHP_EOL for line breaks: $mail = 'Hello [name]' . PHP_EOL . PHP_EOL . 'How are you?'; echo $mail; This will output: Hello [name] How are you? Quote Link to comment https://forums.phpfreaks.com/topic/212262-line-break-help/#findComment-1106111 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.