2013-02-27 81 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 
相关问题