Last active
December 17, 2015 13:49
-
-
Save tahirm/5619467 to your computer and use it in GitHub Desktop.
PHP: Email
This file contains hidden or 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
$aResponse = array('success' => false); | |
$from = $_POST['email']; | |
$message = $_POST['msg']; | |
$subject = $_POST['name']; | |
// To send HTML mail, the Content-type header must be set | |
$headers = 'MIME-Version: 1.0' . "\r\n"; | |
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; | |
$headers .= 'From: ' . $from . "\r\n"; | |
$headers .= 'Bcc: [email protected]' . "\r\n"; | |
$headers .= 'Bcc: [email protected]' . "\r\n"; | |
$reciever = "[email protected]"; | |
if(mail($reciever, $subject, $message, $headers)){ | |
$aResponse['success'] = true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment