<?php ini_set( display_errors, 1 ); error_reporting( E_ALL ); $email = $_POST['myEmail']; $name = $_POST['myName']; $news = $_POST['news']; if($news != 'Yes') $news = 'No'; $to = "web@myemail.com"; $subject = "Add me to the Launch Day Notification List!"; $headers = "From:".$email; $txt = "This person wishes to be added to the launch day notification list".$name <br> "Does this person wish to subscribe to the newsletter?".$news; mail($to,$subject,$headers,$txt); echo "Thank you for your inquiry, you will be added to our launch day notification list!";?> 我的問題出在 $txt 部分,我想在 $name 和 $news 以及句子的最后一個(gè)字符之間留出空格。而且,我如何在兩個(gè)問題之間添加一個(gè)中斷,以便它們輸出如下:此人希望被添加到發(fā)布日通知列表中:在此填寫姓名 此人是否希望訂閱時(shí)事通訊?是或否在這里
1 回答

繁星點(diǎn)點(diǎn)滴滴
TA貢獻(xiàn)1803條經(jīng)驗(yàn) 獲得超3個(gè)贊
只需像這樣添加一個(gè)空格
$txt = "This person wishes to be added to the launch day notification list $name<br>Does this person wish to subscribe to the newsletter? $news";
如果您不發(fā)送 HTML 電子郵件,則應(yīng)將其替換為<br>
類似"\n"
$txt = "This person wishes to be added to the launch day notification list $name\nDoes this person wish to subscribe to the newsletter? $news";
- 1 回答
- 0 關(guān)注
- 147 瀏覽
添加回答
舉報(bào)
0/150
提交
取消