Skip to content

Instantly share code, notes, and snippets.

@woffleloffle
Created May 8, 2014 14:48
Show Gist options
  • Save woffleloffle/c1aea97a0ca2c920bb90 to your computer and use it in GitHub Desktop.
Save woffleloffle/c1aea97a0ca2c920bb90 to your computer and use it in GitHub Desktop.
Super simple HTML mailer sender in PHP
<?php
/**
* Basic mailer.
* @author Willem Labu
*
*
*/
// Edit this:
$to = "me@example.com"; // comma-separate email addresses for multiple receivers.
$subject = "Cunning Linguistics";
// Paste HTML mailer here, and remember to
// escape single quotes with a backslash: 'and then it\'s good to go!'
$message = '';
/**
* The rest.
* Edit this once, and forget.
*/
$from = "sendmail@example.com";
$headers = "From: Me <" . strip_tags($from) . ">\r\n";
$headers .= "Reply-To: noreply <blackhole@example.com>". "\r\n";
# $headers .= "CC: foo@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
// Send the mail
@mail ($to, $subject, $message, $headers);
// Auto EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment