Jump to content

HTML mail


lional

Recommended Posts

Hi All

I am trying to send emails from my script but when I send the mail, my html tags show.

An I doing something wrong

I have included my code below

 

// Recipients. You can send it to more than 1 person!

$to = $email_out . ", " ; // note the comma

$to .= $pur_email_out;

 

// This is the email subject

$my_subject = "Payment Confirmation";

 

// Message

$my_message = <<<PAYMAIL

<html>

<head>

<title>Payment Confirmation</title>

</head>

<body>

<table>

<tr>

<td>Reference No.:</td><td>$reference</td>

</tr>

<tr>

<td>Payment:</td><td>$payment_out</td>

</tr>

<tr>

<td>Chapter:</td><td>$chapter_out</td>

</tr>

<tr>

<td>Name:</td><td>$name_out</td>

</tr>

<tr>

<td>Telephone:</td><td>$telephone_out</td>

</tr>

<tr>

<td>Email Address:</td><td>$email_out</td>

</tr>

<tr>

<td>Total:</td><td>$total_out</td>

</tr>

<tr>

<td>Order Date:</td><td>$order_date_out</td>

</tr>

<tr>

<td>Paid:</td><td>$paid_final</td>

</tr>

</table>

</body>

</html>

PAYMAIL;

 

// To send HTML mail, you can set the Content-type header.

$my_headers = "MIME-Version: 1.0\r\n";

$my_headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

 

// Setting additional headers

$my_headers .= $email_out;

 

// And now mail it!

mail($to, $my_subject, $my_message, $my_headers);

 

Thanks

 

Lional

Link to comment
https://forums.phpfreaks.com/topic/55233-html-mail/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.