Skip to content

Instantly share code, notes, and snippets.

@kshoufer
Created December 27, 2014 03:53
Show Gist options
  • Save kshoufer/fdf49ee7a203ad3169f0 to your computer and use it in GitHub Desktop.
Save kshoufer/fdf49ee7a203ad3169f0 to your computer and use it in GitHub Desktop.
Send HTML email in PHP
<?php
$e = 'bob123@somewhere.com';
$u = 'bob123';
$p = 'password123';
ob_start();
include('output_page.php');
$message = ob_get_contents();
ob_end_clean();
$to = "bob123@somewhere.com";
$from = "sam444@nowhere.com";
$subject = 'Membersite Account Activation - ** ' . $u . ' **';
$message;
$headers = "From: $from\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
mail($to, $subject, $message, $headers);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment