![]() |
New Lines In Message Not Showing Up - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: New Lines In Message Not Showing Up (/showthread.php?tid=65725) |
New Lines In Message Not Showing Up - wolfgang1983 - 07-16-2016 I have now been able to send emails OK. How ever when I revive them they do not show my new lines its just in all one line How do I make sure it displays the correct format. PHP Code: $this->load->library('email'); Config > email.php PHP Code: <?php RE: New Lines In Message Not Showing Up - Wouter60 - 07-16-2016 If mailtype is html, your message must be in html. So instead of "\r\n", simply use the <br /> tag to add a new line. You can also put <p>...</p> around parts of text to create paragraphs. RE: New Lines In Message Not Showing Up - PaulD - 07-17-2016 Or just enclose the message in nl2br. Normally with HTML emails I would send the data to a view and return it as a string to use in the email message field. Gives a much cleaner controller code and keeps html in views. You also need to send the entire message as a full html page. Best wishes, Paul. |