Last active
August 29, 2015 13:56
-
-
Save manviny/9227413 to your computer and use it in GitHub Desktop.
processwire classic mail
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
<?php | |
$start = $input->get->$from; | |
$start = $input->get->$from_name; | |
$start = $input->get->$to; | |
$start = $input->get->$to_name; | |
$subject = $input->get->subject; | |
$start = $input->get-> $message; | |
email_classic($from, $from_name, $to, $to_name, $subject, $message); | |
// classic way | |
function email_classic($from, $from_name, $to, $to_name, $subject, $message){ | |
$from = htmlentities($from_name."<".$from.">"); | |
$headers = "From: {$from}\n"; | |
$headers .= "Reply-To: {$from}\n"; | |
// $headers .= "Cc: {$to}\n"; | |
// $headers .= "Bcc: {$to}\n"; | |
$headers .= "X-Mailer: PHP/".phpversion()."\n"; | |
$headers .= "MIME-Version: 1.0\n"; | |
$headers .= "Content-Type: text/plain; charset=iso-8859-1"; | |
$result = mail($to, $subject, $message, $headers); | |
echo $result ? 'Message sent!' : 'Mailer Error'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment