All pastes #160729 Raw Edit

php mailer

public php v1 · immutable
·published 2006-09-04 17:32 UTC
rendered paste body
function send_email($to, $from, $subject, $message){	// To send HTML mail, the Content-type header must be set	$headers  = 'MIME-Version: 1.0' . "\r\n";	$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";	// Additional headers	$headers .= "To: $to\r\n";	$headers .= "From: $from\r\n";	$headers .= 'X-Mailer: PHP/' . phpversion();	$headers .= "Return-Path: <$to>\r\n";	$headers .= "Delivered-To: $to\r\n";	$headers .= "Message-ID: <PHP@" . $_SERVER['SERVER_NAME'] . ">\r\n";	$headers .= "MIME-Version: 1.0\r\n";	$headers .= "Content-Type: text/html; charset=utf-8";	mail($to, $subject, $message, $headers);	return true;}