Adding line breaks to a text/plain email

后端 未结 2 1050
情书的邮戳
情书的邮戳 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');
    

提交回复
热议问题