Skip to content

Instantly share code, notes, and snippets.

@clintonhalpin
Created May 19, 2013 15:11
Show Gist options
  • Save clintonhalpin/5607936 to your computer and use it in GitHub Desktop.
Save clintonhalpin/5607936 to your computer and use it in GitHub Desktop.
Send HTML Email in PHP
<?php
$to = 'clintonhalpin@gmail.com';
$name = 'Clinton Halpin';
$subject = 'Purchase Successful!';
$message = '<html><head><title>Purchase Successful!</title></head><body><h1>' . $name . '</h1></body></html>';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment