How to make \n\n into line break through mail() ?
Posted: Fri Apr 24, 2009 4:33 pm
How to make \n\n into line break through mail() ?
This is my code so far...
result:
XXX has just sent a comment on your post with the title of 'Project 1'.
'Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.'
thank you,
the server
but what I wish to receive in my email is this below actually,
'Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.'
Many thanks,
Lau
This is my code so far...
Code: Select all
$to_email = 'name@yahoo.co.uk';
$from_name = $row_info_sender['mai_name'];
$host_email = "info@site.com";
$subject = "My Blog: You have a comment!";
$header = "from: http://www.site.com/blog/ <$host_email>";
$message = "$from_name has just sent a comment on your post with the title of '$post_title'.\r\n\n";
$message.= "'$cmt_content'\r\n\n";
$message.= "thank you,\r\n";
$message.= "the server\r\n";
$sentmail = mail($to_email,$subject,$message,$header);XXX has just sent a comment on your post with the title of 'Project 1'.
'Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.\n\nLorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.'
thank you,
the server
but what I wish to receive in my email is this below actually,
'Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla facilisi.
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.'
Many thanks,
Lau