问题
I'm using PHPmailer and everything is perfect except the Texts inside <textarea> are showing as ONE SINGLE LINE. Meaning, no html value (for only TEXTAREA) at all.
- Actually the mail itself is HTML already.
- I can embed Images.. etc as well.
- Just the
<textarea>is not working.
I am using this:
$mail->IsHTML(true);
$mail->Body = $_POST['textarea'];
Lets say the <textarea> contains something like:
Hello,
How are you.
Best Wishes,
4lvin
Then in the email, it is showing just like:
Hello, How are you. Best Wishes, 4lvin
Any idea please? :(
回答1:
use
$mail->IsHTML(true);
$mail->Body = nl2br($_POST['textarea']);
来源:https://stackoverflow.com/questions/13816746/php-textarea-html-value-to-show-in-html-email