Jim
Jim

Reputation: 1315

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. 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: [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);

I am obviously missing something but I am not sure what it is. Thanks

Upvotes: 1

Views: 101

Answers (2)

ImadBakir
ImadBakir

Reputation: 553

at first set headers for the content to be HTML example :

$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>

Upvotes: 5

Ghigo
Ghigo

Reputation: 2332

First of all: don't use mail() function. Use a specific class like PHPMailer(). Really. Don't do it.

Missing // here:

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

Upvotes: 0

Related Questions