/ Published in: PHP
Parameters:\r\n- $to - email address to send the mail\r\n- $subject - subject\r\n- $message - message body (HTML allowed)\r\n- $from_name - sender\'s name\r\n- $from_email - sender\'s email\r\n- $reply_to_name = custom, different from $from_name name to be used for replying to this message\r\n- $reply_to_email = custom, different from $from_email email to be used for replying to this message
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function send_mail($to, $subject, $message, $from_name, $from_email, $reply_to_name=false, $reply_to_email=false) { if($reply_to_name == false) $reply_to_name = $from_name; if($reply_to_email == false) $reply_to_email = $from_email; return false; } return false; } return false; } $headers = 'MIME-Version: 1.0' . PHP_EOL; $headers .= 'From: '.$from_name.' <'.$from_email.'>' . PHP_EOL; $headers .= 'Reply-To: '.$reply_to_name.' <'.$reply_to_email.'>' . PHP_EOL; $headers .= 'Return-Path: '.$from_name.' <'.$from_email.'>' . PHP_EOL; $headers .= 'Content-Type: text/html; charset=UTF-8'.PHP_EOL; $headers .= 'Content-Transfer-Encoding: base64 '.PHP_EOL; return true; } else { return false; } }