zlojkashtan
4/26/2014 - 4:17 PM

processwireMail

<?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';
}

?>