Created
November 11, 2012 12:19
-
-
Save mauromarano/4054750 to your computer and use it in GitHub Desktop.
Function to send email (in html) with 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 email2($to, $title, $text, $from_email, $from_name ){ | |
// costruiamo alcune intestazioni generali | |
$header = "From: ".$from_name." <".$from_email.">\n"; | |
$header .= "X-Mailer: Il nostro Php\n"; | |
// costruiamo le intestazioni specifiche per il formato HTML | |
$header .= "MIME-Version: 1.0\n"; | |
$header .= "Content-Type: text/html; charset=\"iso-8859-1\"\n"; | |
$header .= "Content-Transfer-Encoding: 7bit\n\n"; | |
// inviamo il messaggio di posta elettronica | |
// controllando eventuali errori | |
return @mail($to, $title, $text, $header); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment