123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633 |
- <?php
-
- header("Access-Control-Allow-Origin: *");
-
-
-
- // Only process POST reqeusts.
-
- if ($_SERVER["REQUEST_METHOD"] == "POST") {
-
- // Get the form fields and remove whitespace.
-
- $first_name = strip_tags(trim($_POST["name"]));
-
- $first_name = str_replace(array("\r","\n"),array(" "," "),$first_name);
-
- $email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL);
-
- $subject = trim($_POST["subject"]);
-
- // $phone = trim($_POST["number"]);
-
- $message = trim($_POST["contactMessage"]);
-
-
- // Check that data was sent to the mailer.
-
- if ( empty($first_name) OR empty($message) OR !filter_var($email, FILTER_VALIDATE_EMAIL)) {
-
- // Set a 400 (bad request) response code and exit.
-
- http_response_code(400);
-
- echo "Please complete the form and try again.";
-
- exit;
-
- }
-
-
- // Set the recipient email address.
-
- $recipient = "mailcheck@whizthemes.com";
-
- // Set the email subject.
-
- $subject = "Ketab - Mail From $first_name";
-
- // Build the email content.
-
- $email_content =
-
- '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
- <html lang="en">
-
- <head>
-
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-
- <meta name="viewport" content="width=device-width, initial-scale=1">
-
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
-
-
-
- <title>Contact Mail</title>
-
-
-
- <!--[if (mso)|(mso 16)]>
-
- <style type="text/css">
-
- body, table, td, a, span { font-family: Arial, sans-serif !important; }
-
- a {text-decoration: none !important;}
-
- </style>
-
- <![endif]-->
-
- <style type="text/css">
-
- /* CLIENT-SPECIFIC STYLES */
-
-
-
- body,
-
- table,
-
- td,
-
- a {
-
- -webkit-text-size-adjust: 100%;
-
- -ms-text-size-adjust: 100%;
-
- }
-
-
-
- table,
-
- td {
-
- mso-table-lspace: 0pt;
-
- mso-table-rspace: 0pt;
-
- }
-
-
-
- img {
-
- -ms-interpolation-mode: bicubic;
-
- }
-
-
-
- /* RESET STYLES */
-
-
-
- img {
-
- border: 0;
-
- outline: none;
-
- text-decoration: none;
-
- }
-
-
-
- table {
-
- border-collapse: collapse !important;
-
- }
-
-
-
- body {
-
- color: #626160!important;
-
- font-family: Tahoma, Arial, sans-serif !important;
-
- font-size: 14px;
-
- margin: 0 !important;
-
- padding: 0 !important;
-
- width: 100% !important;
-
- }
-
-
-
- h1,
-
- h2,
-
- h3,
-
- h4,
-
- h5,
-
- h6,
-
- p,
-
- img {
-
- margin: 0;
-
- padding: 0;
-
- }
-
-
-
- /* iOS BLUE LINKS */
-
-
-
- a[x-apple-data-detectors] {
-
- color: inherit !important;
-
- text-decoration: none !important;
-
- font-size: inherit !important;
-
- font-family: inherit !important;
-
- font-weight: inherit !important;
-
- line-height: inherit !important;
-
- }
-
-
-
- /* ANDROID CENTER FIX */
-
-
-
- div[style*="margin: 16px 0;"] {
-
- margin: 0 !important;
-
- }
-
-
-
- /* MEDIA QUERIES */
-
-
-
- @media all and (max-width:639px) {
-
- .wrapper {
-
- width: 320px!important;
-
- padding: 0 !important;
-
- }
-
- .container {
-
- width: 300px!important;
-
- padding: 0 !important;
-
- }
-
- .mobile {
-
- width: 300px!important;
-
- display: block!important;
-
- padding: 0 !important;
-
- }
-
- .img {
-
- width: 100% !important;
-
- height: auto !important;
-
- }
-
- *[class="mobileOff"] {
-
- width: 0px !important;
-
- display: none !important;
-
- }
-
- *[class*="mobileOn"] {
-
- display: block !important;
-
- max-height: none !important;
-
- }
-
- }
-
-
-
-
-
- /*===========================
-
- Author Custom Style
-
- ============================*/
-
- hr{
-
- border-color: #fefefe;
-
- border-width: 1px;
-
- margin-bottom: 10px;
-
- }
-
-
-
- .message-content{
-
- font-size: 16px;
-
- line-height: 1.6;
-
- }
-
-
-
- .content-wrapper h2{
-
- font-weight: 400;
-
- font-size: 20px;
-
- }
-
-
-
- .email-txt a{
-
- color: #222222 !important;
-
- text-decoration: none !important;
-
- }
-
-
-
- </style>
-
- </head>
-
-
-
- <body style="margin:0; padding:0; background-color:#F3F3F3;">
-
- <center>
-
- <table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#F2F2F2">
-
- <tr>
-
- <td height="100" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
- <tr>
-
- <td align="center" valign="top">
-
- <!--== TemplateContainer Start ==-->
-
- <table width="640" cellpadding="0" cellspacing="0" border="0" class="wrapper" bgcolor="#FFFFFF">
-
- <tr>
-
- <td height="60" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
-
-
- <!--== Content Area Start ==-->
-
- <tr class="content-wrapper">
-
- <td align="center" valign="top">
-
- <table width="560" cellpadding="0" cellspacing="0" border="0" class="container">
-
-
-
- <!--== Start Name Field Item ==-->
-
- <tr>
-
- <td width="100%" class="mobile" align="left" valign="middle">
-
- <h3>Name:</h3>
-
- <hr>
-
- <h2>' . $first_name. '</h2>
-
- </td>
-
- </tr>
-
- <!--== End Name Field Item ==-->
-
-
-
- <!--== Start Separator ==-->
-
- <tr>
-
- <td height="30" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
- <!--== End Separator ==-->
-
-
-
- <!--== Start Email Field Item ==-->
-
- <tr>
-
- <td width="100%" class="mobile" align="left" valign="middle">
-
- <h3>Email:</h3>
-
- <hr>
-
- <h2 class="email-txt">'. $email .'</h2>
-
- </td>
-
- </tr>
-
- <!--== Start Email Field Item ==-->
-
-
-
- <!--== Start Separator ==-->
-
- <tr>
-
- <td height="30" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
- <!--== End Separator ==-->
-
-
-
- <!--== Start Phone Field Item ==-->
-
- // <tr>
-
- // <td width="100%" class="mobile" align="left" valign="middle">
-
- // <h3>Phone or Mobile:</h3>
-
- // <hr>
-
- // <h2>'. $phone .'</h2>
-
- // </td>
-
- // </tr>
-
- <!--== End Phone Field Item ==-->
-
-
-
- <!--== Start Separator ==-->
-
- <tr>
-
- <td height="30" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
- <!--== End Separator ==-->
-
-
-
- <!--== Start Subject Field Item ==-->
-
- <tr>
-
- <td width="100%" class="mobile" align="left" valign="middle">
-
- <h3>Subject:</h3>
-
- <hr>
-
- <h2>'. $subject .'</h2>
-
- </td>
-
- </tr>
-
- <!--== End Subject Field Item ==-->
-
-
-
- <!--== Start Separator ==-->
-
- <tr>
-
- <td height="30" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
- <!--== End Separator ==-->
-
-
-
- <!--== Start Message Field Item ==-->
-
- <tr>
-
- <td width="100%" class="mobile" align="left" valign="middle">
-
- <h3>Message:</h3>
-
- <hr>
-
- <p class="message-content">'. $message .'</p>
-
- </td>
-
- </tr>
-
- <!--== End Message Field Item ==-->
-
- </table>
-
- </td>
-
- </tr>
-
- <!--== Content Area End ==-->
-
-
-
- <tr>
-
- <td height="60" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
- </table>
-
- <!--== TemplateContainer End ==-->
-
- </td>
-
- </tr>
-
-
-
- <tr>
-
- <td height="20" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
-
-
- <tr>
-
- <td align="center" valign="top">
-
- <a href="https://hasthemes.com/" target="_blank"><img width="120" src="https://hasthemes.com/wp-content/uploads/2019/01/1.png" alt="HasThemes"></a>
-
- </td>
-
- </tr>
-
-
-
- <tr>
-
- <td height="100" style="font-size:10px; line-height:10px;"> </td>
-
- </tr>
-
- </table>
-
- </center>
-
- </body>
-
- </html>';
-
-
-
- // Build the email headers.
-
- $email_headers = "MIME-Version: 1.0" . "\r\n";
-
- $email_headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
-
- $email_headers .= 'From:' . $first_name . ' ' . 'noreply@yourdomain.com' . "\r\n";
-
- $email_headers .= 'Reply-To:' . $email . "\r\n";
-
-
-
- // Send the email.
-
- if (mail($recipient, $subject, $email_content, $email_headers)) {
-
- // Set a 200 (okay) response code.
-
- http_response_code(200);
-
- echo "Thank You! Your message has been sent.";
-
- } else {
-
- // Set a 500 (internal server error) response code.
-
- http_response_code(500);
-
- echo "Oops! Something went wrong and we couldn't send your message.";
-
- }
-
-
-
- } else {
-
- // Not a POST request, set a 403 (forbidden) response code.
-
- http_response_code(403);
-
- echo "There was a problem with your submission, please try again.";
-
- }
-
-
-
- ?>
|