Last active
December 18, 2015 10:59
-
-
Save mihai-vlc/5772966 to your computer and use it in GitHub Desktop.
PHP: sendMail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function sendMail($to, $subject, $message, $from = 'From: [email protected]', $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