2013-02-27 101 views
1

我試圖在由php生成的電子郵件中包含鏈接。我已經看到了我能找到的這些例子,但我仍然無法工作,需要一些幫助。這是我有:包含由php生成的電子郵件中的鏈接

//send email when pricing specs are done 
$to = $email; 
$subject = "Final Check In"; 
$headers = "From: [email protected]" . "\r\n" . 
"CC: [email protected],[email protected],[email protected]"; 
$body = "Greetings " .$name."!\nWe have completed checking in your latest shipment of books.\nCheck-In date was: " .$finaldate."\n 
We checked in " .$count." books.\nA total of " .$notListed." books are not listed yet and have been set aside to be researched.\nComments: ".$comments. "\n 
You will now be able to review your shipment details here : '<a href = http:www.bookcellaronline.com/bcos/advances/buyertotal.php>Check In Details</a>'. Use the Check-In date from above.\n 
This is an automated email - do not reply to this email. If you have any questions or concerns, please contact your Manager or Abbie.\n"; 
$body = wordwrap($body,70); 
mail($to, $subject, $body, $headers); 

我明顯缺少的東西,但我不知道它是什麼。 謝謝

回答

5

在第一組頭的內容是HTML 例如:

$headers .= "MIME-Version: 1.0\r\n"; 
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; 

然後加入這樣

<a href = "http://www.bookcellaronline.com/bcos/advances/buyertotal.php">Check In Details</a> 
鏈接
0

首先:不要使用mail()函數。使用PHPMailer()等特定的類。 真的。不要這樣做。

缺少//這裏:

<a href = http://www.bookcellaronline.com 
相關問題