HTML in php mail function

后端 未结 1 1667
悲哀的现实
悲哀的现实 2021-01-25 09:47

I have a contact form on my website so users can send me an email but I have run into a problem.

I want to use an HTML link inside the email and I also want the content

1条回答
  •  不思量自难忘°
    2021-01-25 10:15

    Use nl2br on your message - http://php.net/manual/en/function.nl2br.php

    It will replace all newlines with HTML

    $message = nl2br($message, false);
    

    The second parameter *is_xhtml* is optional if you want to send an HTML email instead of XHTML

    0 讨论(0)
提交回复
热议问题