Creating A New Line In $body Of PHP Mail Function

后端 未结 6 809
感情败类
感情败类 2021-01-02 07:50

I\'ve got the PHP mail(): function working for a form I\'m using on my site. I am now trying to format the $body attribute to look nicer and more organized when I receive th

6条回答
  •  囚心锁ツ
    2021-01-02 08:37

    From the manual page of the mail() function, we learn that in order to send HTML emails, extra headers need to be said. This is concisely demonstrated in Example #4.

    However, for just line breaks, I wouldn't advise using HTML. For that, simply insert "\n" in the string, making sure to use double quotes, as mentioned by Abraham.

提交回复
热议问题