Process.php
<?php $redirectTo = '/thankyou.html'; $subject = 'New message from site'; // Email SUBJECT field $receive = array( '[email protected]' ); if($_POST['email_check'] == '') { if (isset($_POST['first_name'])){ $message = '<table width="100%" border="0" cellspacing="0" cellpadding="8" style="border:1px solid #f3f3f3"> <tr> <td colspan="3" height="30" style="font-size:20px"><strong>' . $subject . '</strong></td> </tr> <tr> <td width="100" bgcolor="#f3f3f3"><strong>First Name: </strong></td> <td width="14" height="30" bgcolor="#f3f3f3"> </td> <td width="305" bgcolor="#f3f3f3">' . $_POST ['first_name'] . '</td> </tr> <tr> <td><strong>Last Name: </strong></td> <td width="14" height="30"> </td> <td>' . $_POST ['last_name'] . '</td> </tr> <tr> <td bgcolor="#f3f3f3"><strong>Email: </strong></td> <td bgcolor="#f3f3f3" width="14" height="30"> </td> <td bgcolor="#f3f3f3">' . $_POST ['email'] . '</td> </tr> <tr> <td><strong>Phone Number: </strong></td> <td width="14" height="30"> </td> <td>' . $_POST ['phone'] . '</td> </tr> <tr> <td bgcolor="#f3f3f3"><strong>Check: </strong></td> <td bgcolor="#f3f3f3" width="14" height="30"> </td> <td bgcolor="#f3f3f3">'; foreach($_POST['role'] as $value) { $message.=$value.'<br>'; } $message.='</td> </tr> <tr> <td><strong>Message: </strong></td> <td width="14" height="30"> </td> <td>' . $_POST ['message'] . '</td> </tr> <tr> <td><strong>Referer:</strong></td> <td width="14" height="30"> </td> <td>' . $_SERVER ['HTTP_REFERER'] . '</td> </tr> <tr> </table>'; for ($i = 0; $i < count($receive); $i++){ $to = $receive[$i]; $headers = 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\n"; $headers .= 'From: ' . $_POST['email'] . "\n" . 'Reply-To: ' . $_POST['email'] . "\n"; mail($to, $subject, $message,$headers); } header('Location: '.$redirectTo); } } else{ header('Location:'.$_SERVER['HTTP_REFERER']); die(); } ?>