Last active
December 28, 2015 18:09
-
-
Save aswebdev/16f0a19b7dc9d1a06087 to your computer and use it in GitHub Desktop.
Function for creating HTML emails in PHP
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
function createEmail($to,$from,$subject,$content,$cc=false,$bcc=false) { | |
$headers = "From:$from\r\n"; | |
$headers .= "CC:".$bcc."\r\n"; | |
$headers .= "BCC:".$bcc."\r\n"; | |
$headers .= "MIME-Version: 1.0\r\n"; | |
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; | |
mail($to,$subject,$content,$headers); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment