'; $html_message = ''; $html_message .= ''; $html_message .= ''; $html_message .= 'Contact Form Request'; $html_message .= ''; $html_message .= ''; $html_message .= ''; $html_message .= ''.$_POST['last_name'].', '.$_POST['first_name'].' ('.$_POST['email_address'].') has used the contact form to send you the following message:


'; $html_message .= '(Company: '.$_POST['company'].')
(Phone: '.$_POST['phone'].')


'; $html_message .= ''.$_POST['message'].''; $html_message .= '
'; $related_boundary = "RELATED_CONTENT"; $alternative_boundary = "ALTERNATIVE_CONTENT"; $headers = "MIME-Version: 1.0".PHP_EOL; $headers .= "Date: ".date("D, d M Y H:i:s") . " PDT".PHP_EOL; $headers .= "From: sourcenergy.com ".PHP_EOL; $headers .= "Reply-To: contact@sourcenergy.com ".PHP_EOL; $headers .= "Return-Path: ".PHP_EOL; $headers .= 'Content-Type: multipart/related;'.PHP_EOL.chr(9).'boundary="=='.$related_boundary.'";'.PHP_EOL.chr(9).'type="multipart/alternative"'.PHP_EOL.PHP_EOL; $headers .= "X-Priority: 3".PHP_EOL; $headers .= "X-MimeOLE: Produced By PHP HTML-Mailer".PHP_EOL; $headers .= "X-MSMail-Priority: Normal".PHP_EOL; $headers .= "X-Mail-Priority: Normal".PHP_EOL; $headers .= "X-Mailer: PHP HTML-Mailer\n".PHP_EOL.PHP_EOL; $message = 'Text displayed only to non-MIME-compliant mailers'.PHP_EOL; $message .= '--=='.$related_boundary.PHP_EOL; $message .= 'Content-Type: multipart/alternative; boundary="=='.$alternative_boundary.'"'.PHP_EOL.PHP_EOL; $message .= '--=='.$alternative_boundary.PHP_EOL; $message .= 'Content-Type: text/plain; charset=us-ascii'.PHP_EOL.'Content-Transfer-Encoding: 7bit'.PHP_EOL.PHP_EOL; $plainText = 'Please view the included HTML encoded message to review this message.'; $message .= wordwrap($plainText, 76, PHP_EOL).PHP_EOL; $message .= '--=='.$alternative_boundary.PHP_EOL; $message .= 'Content-Type: text/html; charset=us-ascii'.PHP_EOL.'Content-Transfer-Encoding: base64'.PHP_EOL.PHP_EOL; $message .= chunk_split(base64_encode($html_message)).PHP_EOL; $message .= '--=='.$alternative_boundary.'--'.PHP_EOL; if($relatedContentArray) foreach($relatedContentArray as $currentRelatedContent) $message .= $currentRelatedContent; $message .= '--=='.$related_boundary.'--'; mail("info@sourceenergy.com.sa", "Contact Form Request", $message, $headers); }else{ echo '
'; ?> /> /> /> /> />
'; } ?>