1

我正在尝试在由 php 生成的电子邮件中包含一个链接。我已经查看了此处可以找到的示例,但我仍然无法让我的工作并需要一些帮助。这是我所拥有的:

    //send email when pricing specs are done
$to = $email;
$subject = "Final Check In";
$headers = "From: Warehouse@bookcellaronline.com" . "\r\n" .
"CC: micahpartnerships@gmail.com,lreyes@bookcellaronline.com,jimd@bookcellaronline.com";
$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);

我显然错过了一些东西,但我不确定它是什么。谢谢

4

2 回答 2

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>
于 2013-02-27T15:21:07.197 回答
0

首先:不要使用 mail() 函数。使用特定的类,如 PHPMailer()。真的。不要这样做。

此处缺少//:

<a href = http://www.bookcellaronline.com
于 2013-02-27T15:20:44.397 回答