Adding line breaks to a text/plain email

后端 未结 2 1022
情书的邮戳
情书的邮戳 2021-02-05 00:56

I\'m having a problem sending a plain text (not HTML!) email, all my line breaks are being ignored:

->setBody(\'Did you request a pa         


        
相关标签:
2条回答
  • 2021-02-05 01:27

    You are using literal strings. If you would like to add the line breaks, use double quotes instead of a single quote.

    ->setBody("Did you request a password reset for your account?\r\n\r\nIf yes, click here:\r\nhttp://www.website.com", 'text/plain');
    
    0 讨论(0)
  • 2021-02-05 01:27

    use double quotes like this

    ->setBody("Did you request a password reset for your account?\r\n\r\nIf yes, click here:\r\nhttp://www.website.com", 'text/plain');
    
    0 讨论(0)
提交回复
热议问题