简体   繁体   English

在php生成的电子邮件中包含一个链接

[英]include a link in an email generated by php

I am trying to include a link in an email that is being generated by php. 我正在尝试在php生成的电子邮件中包含一个链接。 I have looked at the examples on here that I can find, but I still can't get mine to work and need some assistance. 我看了这里可以找到的示例,但是仍然无法找到我的工作,需要一些帮助。 Here is what I have: 这是我所拥有的:

    //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);

I am obviously missing something but I am not sure what it is. 我显然缺少了一些东西,但是我不确定它是什么。 Thanks 谢谢

at first set headers for the content to be HTML example : 首先将内容的标头设置为HTML示例:

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

Then add the link like this 然后像这样添加链接

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

First of all: don't use mail() function. 首先:不要使用mail()函数。 Use a specific class like PHPMailer(). 使用特定的类,例如PHPMailer()。 Really. 真。 Don't do it. 不要这样

Missing // here: //在这里缺少:

<a href = http://www.bookcellaronline.com

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM