plain text email newline - EnglishEssaywritercsClub

plain text email newline


Microsoft Edge


Try Microsoft Edge
A fast and secure browser that’s designed for Windows 10



Get started

Skip to main content


Microsoft
Microsoft


Microsoft Support

Sign in

Microsoft Support


Javascript is disabled

Please enable javascript and refresh the page

search404Captions.backgroundAltText

search404Captions.content404Title

search404Captions.content404Description

Cookies are disabled

Please enable cookies and refresh the page

CV: getCv()

MacWorks


Back


Plain Text Email & Line Breaks


MacWorks
posted 3 years ago

Blade

Mail

How does one add a line break to the plain text version of an email message when using a blade template?

nesl247
replied
3 years ago

You must be using double quotes, and you use \r\n to make a new line.

Example:

"Something\r\nOn\r\nA\r\nNew\r\nLine"

MacWorks
replied
3 years ago

That doesn’t work … it simply adds "\r\n" into the output

MacWorks
replied
3 years ago


Solution

The issue turned out to be that if only sending text, one must explicitly pass an array to the Mail::(send/queue) call as follows:

Mail::send(array('text' => $text_view), ...

If you:

Mail::send($text_view, ...

The message is assumed to be HTML

dimplea999
replied
2 years ago

\r\n this works for me. thanks.


Sign in to participate in this thread!



We’d like to thank these amazing companies for supporting us


Copyright © 2013 – 2018 Laravel.io •
Terms •
Privacy •