function mailuser($address) { # To Email Address $eol = "\r\n"; $emailaddress = $address; # Message Subject $emailsubject = "Welcome to the Young Inventors Hub Mailing List!"; # Message Body ob_start(); # Open File with Message body! require("includes/mailinglist_message.html"); $body=ob_get_contents(); ob_end_clean(); # Common Headers $headers .= 'From: Young Inventors Hub '.$eol; $headers .= 'Reply-To: Young Inventors Hub '.$eol; $headers .= 'Return-Path: Young Inventors Hub '.$eol; // these two to set reply address $headers .= "Message-ID: <".$now." info@".$_SERVER['SERVER_NAME'].">".$eol; $headers .= "X-Mailer: PHP v".phpversion().$eol; $mime_boundary=md5(time()); $headers .= 'MIME-Version: 1.0'.$eol; $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol; # HTML Version $msg .= "--".$mime_boundary.$eol; $msg .= "Content-Type: text/html; charset=iso-8859-1".$eol; $msg .= "Content-Transfer-Encoding: 8bit".$eol; $msg .= $body.$eol.$eol; # Finished $msg .= "--".$mime_boundary."--".$eol.$eol; // finish with two eol's for better security. see Injection. # SEND THE EMAIL ini_set(sendmail_from,'info@younginventorshub.com'); // the INI lines are to force the From Address to be used ! mail($emailaddress, $emailsubject, $msg, $headers); ini_restore(sendmail_from); }