w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How do I turn a PHP variable string to output HTML?

Assuming you're using the built in mail function in PHP:

// multiple recipients
$to  = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
  <title>Birthday Reminders for August</title>
  <p>Here are the birthdays upcoming in August!</p>

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "

// Mail it
mail($to, $subject, $message, $headers);

This example is from: http://us2.php.net/manual/en/function.mail.php

The important part is the $headers variable.

By the way, as andrewsi mentioned - you need to escape your quotes:

$respondmessage = "Hello $fullname,
    We are confirming your Appointment today!
    Please <a href="http://yourlink.com/">click here to

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.