【发布时间】:2019-05-17 16:09:27
【问题描述】:
我正在使用另一个版本的 mail 函数并试图让 \n\n 工作,但它没有按预期生成单独的行。
这是我的代码:
// email body content
$htmlContent = "<h1>Thank-you for purchasing your Level 1 Monthly Subscriptionplan!</h1>
<p>Dear $name \n\nThank you for purchasing your Level 1 Monthly Subscriptionplan for $price. \n\nPlease make sure that you check your student's general information to view your details carefully and note the expiry date for your subscriptionplan.\n\nFrom,\n\nPianoCourse101</p>";
【问题讨论】:
-
在 HTML 中,换行符被折叠成一个空格。对于您的情况,将每一行包装在单独的段落中会更有意义。