Skip to content

Instantly share code, notes, and snippets.

@mihai-vlc
Last active December 18, 2015 10:59
Show Gist options
  • Save mihai-vlc/5772966 to your computer and use it in GitHub Desktop.
Save mihai-vlc/5772966 to your computer and use it in GitHub Desktop.
PHP: sendMail
<?php
function sendMail($to, $subject, $message, $from = 'From: no.reply@dot.com', $isHtml = true) {
$from .= "\r\n"; // we make sure we have an endline
if($isHtml) {
$from .= "MIME-Version: 1.0 \r\n";
$from .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
}
$from .= 'X-Mailer: PHP/'.phpversion()."\r\n";
return mail($to, $subject, $message, $from);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment