我一直在尋找大約一個小時,谷歌不是我的朋友。我已經改變了我的代碼,添加\ n \ r,添加純文本格式,HTML格式...PHP新行將不打印
的電子郵件打印成這樣:
Below is the site survey information for test Restaurant Name: test Contact Name: test Walk-Thru Contact Name: test Site Surveyor: Brandon Projected Install Date: test Projected Opening Date: test Projected Completion Date: test
Item(s) Needed: test
Priority Level: Necessary for Install
Item(s) Needed:
Priority Level: Necessary for Install
Item(s) Needed:
Priority Level: Necessary for Install
只有前幾行印刷在一起,但是完成日期之後的所有內容都是以新行打印。以下是目前爲止的消息代碼:
//Prepare content
$subject = "Site Survey Information";
$from_header = "From: $formval_RestaurantName";
$headers .= "Content-type: textrn";
$to = "$formval_receiver";
$contents .= "Below is the site survey information for $formval_RestaurantName\r\n";
$contents .= "Restaurant Name: $formval_RestaurantName\r\n";
$contents .= "Contact Name: $formval_ContactName\r\n";
$contents .= "Walk-Thru Contact Name: $formval_walkthru\r\n";
$contents .= "Site Surveyor: $formval_surveyor\r\n";
$contents .= "Projected Install Date: $formval_install\r\n";
$contents .= "Projected Opening Date: $formval_open\r\n";
$contents .= "Projected Completion Date: $formval_finish\r\n";
$contents .= "Item(s) Needed: $formval_items1\r\n";
$contents .= "Priority Level: $formval_priority_1\r\n";
$contents .= "Item(s) Needed: $formval_items2\r\n";
$contents .= "Priority Level: $formval_priority_2\r\n";
$contents .= "Item(s) Needed: $formval_items3\r\n";
$contents .= "Priority Level: $formval_priority_3\r\n";
$contents .= "Item(s) Needed: $formval_items4\r\n";
$contents .= "Priority Level: $formval_priority_4\r\n";
$contents .= "Item(s) Needed: $formval_items5\r\n";
$contents .= "Priority Level: $formval_priority_5\r\n";
$contents .= "Item(s) Needed: $formval_items6\r\n";
$contents .= "Priority Level: $formval_priority_6\r\n";
$contents .= "Item(s) Needed: $formval_items7\r\n";
$contents .= "Priority Level: $formval_priority_7\r\n";
$contents .= "Item(s) Needed: $formval_items8\r\n";
$contents .= "Priority Level: $formval_priority_8\r\n";
$contents .= "Item(s) Needed: $formval_items9\r\n";
$contents .= "Priority Level: $formval_priority_9\r\n";
$contents .= "Item(s) Needed: $formval_items10\r\n";
$contents .= "Priority Level: $formval_priority_10\r\n";
$contents .= "Item(s) Needed: $formval_items11\r\n";
$contents .= "Priority Level: $formval_priority_11\r\n";
$contents .= "Item(s) Needed: $formval_items12\r\n";
$contents .= "Priority Level: $formval_priority_12\r\n";
$contents .= "Item(s) Needed: $formval_items13\r\n";
$contents .= "Priority Level: $formval_priority_13\r\n";
$contents .= "Item(s) Needed: $formval_items14\r\n";
$contents .= "Priority Level: $formval_priority_14\r\n";
$contents .= "Item(s) Needed: $formval_items15\r\n";
$contents .= "Priority Level: $formval_priority_15\r\n";
我還能做些什麼來讓它打印新行?
什麼是Content-type中的「textrn」? – allaire 2012-03-21 19:43:52
你看到哪個電子郵件客戶端沒有打印新行,或者你只是在瀏覽器中查看它?雖然電子郵件HTML通常是非常挑剔的,但基礎知識(如'
')仍然在全面工作。對於每次需要文本以新行開始時,您應告訴PHP打印一個網站上看到的'
' – Mattygabe 2012-03-21 19:45:15
,有人說會將其轉換爲純文本電子郵件。由於我一直在研究這個代碼一個月,但它還沒有真正起作用,所以我已經迫不及待地嘗試了任何東西。 – user1284324 2012-03-21 19:45:44