Advertisement
Guest User

Untitled

a guest
Feb 27th, 2018
340
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.89 KB | None | 0 0
  1. <?php
  2. /*
  3. Name: Contact Form
  4. Written by: Okler Themes - (http://www.okler.net)
  5. Theme Version: 6.0.0
  6. */
  7.  
  8. session_cache_limiter('nocache');
  9. header('Expires: ' . gmdate('r', 0));
  10.  
  11. header('Content-type: application/json');
  12.  
  13. require_once('php-mailer/PHPMailerAutoload.php');
  14.  
  15. // Step 1 - Enter your email address below.
  16. $email = 'bestupload2@gmail.com';
  17.  
  18. // If the e-mail is not working, change the debug option to 2 | $debug = 2;
  19. $debug = 0;
  20.  
  21. $subject = $_POST['subject'];
  22.  
  23. $fields = array(
  24. 0 => array(
  25. 'text' => 'Name',
  26. 'val' => $_POST['name']
  27. ),
  28. 1 => array(
  29. 'text' => 'Email address',
  30. 'val' => $_POST['email']
  31. ),
  32. 2 => array(
  33. 'text' => 'Message',
  34. 'val' => $_POST['message']
  35. )
  36. );
  37.  
  38. $message = '<html>
  39. <head>
  40. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  41. <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  42. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  43. <title>Formulaire de contact de BestUPLOAD</title>
  44. </head>
  45. <body style="margin:0;min-width:100%;font-family:Calibri,Arial,sans-serif;-webkit-font-smoothing:antialiased;mso-line-height-rule:exactly;background-color:#4d3e39;padding:0">
  46. <center class="wrapper" style="width:100%;table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;background-color:#4d3e39">
  47. <table class="main" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#4d3e39;" style="background-color:#4d3e39">
  48. <tr>
  49. <td class="full-width" style="width:100%">
  50. <div class="webkit" style="max-width:600px;margin:0 auto">
  51. <!--[if (gte mso 9)|(IE)]>
  52. <table width="600" align="center" cellpadding="0" cellspacing="0" border="0" style="border-spacing:0;font-family: Calibri, sans-serif;color:#333333;" >
  53. <tr>
  54. <td style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
  55. <![endif]-->
  56. <!-- ======= start main body ======= -->
  57. <table class="outer" align="center" cellpadding="0" cellspacing="0" border="0" style="margin:0 auto;width:100%;max-width:600px;border-spacing:0;color:#333">
  58. <tr>
  59. <td class="no-padding" style="padding:0" bgcolor="#f3f0e6" style="color:#f3f0e6">
  60. <!-- ======= start header ======= -->
  61. <table class="header-content" style="margin:0 auto;min-height:160px" border="0" cellpadding="0" cellspacing="0" align="center">
  62. <tbody>
  63. <tr>
  64. <td align="center">
  65. <a class="full-width-image" href="https://www.bestupload.fr.fo" style="display:block;border:0!important;">
  66. <img src="https://www.bestupload.fr.fo/public/new/images/preview-600-160.png" alt="" style="display:block;width:100%;max-width:600px;height:auto" />
  67. </a>
  68. </td>
  69. </tr>
  70. </tbody>
  71. </table>
  72. <!-- ======= end article1 ======= -->
  73. <table border="0" cellpadding="20" cellspacing="0" width="100%" style="" bgcolor="#f3f0e6" style="color:#f3f0e6">
  74. <tr>
  75. <td class="one-column no-padding" bgcolor="#222222" style="border-spacing:0;padding:0">
  76. <h1 style="font-family:Georgia,sans-serif;font-size:25px;mso-line-height-rule:exactly;line-height:40px;font-weight:400!important;text-decoration:none;text-align:center;font-style:italic;margin:10px;color:#f3f0e6">
  77. '.$subject = $_POST["subject"].'
  78. </h1>
  79. <center>
  80. <table cellpadding="0" cellspacing="0" border="0" width="100%">
  81. <tbody>
  82. <tr>
  83. <td>
  84. <table border="0" align="center" cellpadding="0" cellspacing="0" style="Margin:0 auto;">
  85. <tbody>
  86. <tr>
  87. <td align="center">
  88. <table border="0" cellpadding="0" cellspacing="0" style="Margin:0 auto;">
  89. <tbody>
  90. <tr>
  91. <td align="center" bgcolor="#db7447" class="border-rounded width-150" style="-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px">
  92. <a href="https://www.bestupload.fr.fo" class="button-link" style="padding:10px;width:150px;display:block;text-decoration:none;border:0;text-align:center;font-weight:700;font-size:14px;font-family:Arial,sans-serif;color:#fff;background:#db7447;border:1px solid #db7447;-moz-border-radius:2px;-webkit-border-radius:2px;border-radius:2px;mso-line-height-rule:exactly;line-height:17px;text-transform:uppercase;letter-spacing:1px">Visitez nous</a>
  93. </td>
  94. </tr>
  95. </tbody>
  96. </table>
  97. </td>
  98. </tr>
  99. </tbody>
  100. </table>
  101. <table border="0" cellpadding="0" cellspacing="0">
  102. <tbody>
  103. <tr>
  104. <td class="full-width" style="font-size: 20px; height:20px; mso-line-height-rule:exactly; line-height: 20px;">&nbsp;
  105. </td>
  106. </tr>
  107. </tbody>
  108. </table>
  109. </td>
  110. </tr>
  111. </tbody>
  112. </table>
  113. </center>
  114. </td>
  115. </tr>
  116. <tr>
  117. <td class="content-text">
  118. <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Nom de famille: </span>' .$_POST["name"].'</p>
  119. <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Prénom: </span>'.$_POST["first_name"].'</p>
  120. <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Email: </span>'.$_POST["email"].'</p>
  121. <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Téléphone: </span>'.$_POST["phone"].'</p>
  122. <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Sujet: </span>'.$_POST["subject"].'</p>
  123. <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Message: </span>'.$_POST["message"].'</p>
  124. <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Fichier: </span>'.$_POST["file_1"].'</p>
  125. <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Adresse ip: </span>'. $_SERVER["REMOTE_ADDR"].'</p>
  126. </td>
  127. </tr>
  128. </table>
  129. <!-- ======= end article1 ======= -->
  130. <!-- ======= start footer ======= -->
  131. <table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f3f0e6" style="color:#f3f0e6">
  132. <tr>
  133. <td class="one-column no-padding" style="border-spacing:0;padding:0">
  134. <table border="0" cellpadding="5" cellspacing="0" width="100%">
  135. <tbody>
  136. <tr>
  137. <td class="divider" style="height:10px!important;font-size:5px!important;mso-line-height-rule:exactly;line-height:5px!important"> </td>
  138. </tr>
  139. <tr>
  140. <td style="text-align:center;">
  141. <!-- Start: Separator table 1 -->
  142. <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
  143. <tr>
  144. <td class="separator" style="height:1px!important;font-size:1px!important;color:#f3f0e6!important;mso-line-height-rule:exactly!important;line-height:1px!important;border-top:1px solid #999!important;padding-top:10px!important">-</td>
  145. </tr>
  146. </table>
  147. <!-- End: Separator table 1 -->
  148. <!-- Start: Social -->
  149. <span style="font-size: 15px; mso-line-height-rule:exactly; line-height:18px; color: #000000;font-family: Georgia, sans-serif;font-style:italic;">rejoignez-nous sur les réseaux sociaux  /</span>
  150. <a href="#"><img src="https://www.bestupload.fr.fo/public/new/images/social-icon-twitter-black.png" width="22" alt="" class="social" style="border-width:0;margin:0 auto;display:inline-block;vertical-align:middle" /></a>
  151. <a href="#"><img src="https://www.bestupload.fr.fo/public/new/images/social-icon-facebook-black.png" width="22" alt="" class="social" style="border-width:0;margin:0 auto;display:inline-block;vertical-align:middle" /></a>
  152. <!-- End: Social -->
  153. <!-- Start: Separator table 2 -->
  154. <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
  155. <tr>
  156. <td class="divider" style="height:10px!important;font-size:5px!important;mso-line-height-rule:exactly;line-height:5px!important"> </td>
  157. </tr>
  158. <tr>
  159. <td class="separator" style="height:1px!important;font-size:1px!important;color:#f3f0e6!important;mso-line-height-rule:exactly!important;line-height:1px!important;border-top:1px solid #999!important;padding-top:10px!important">-</td>
  160. </tr>
  161. </table>
  162. <!-- End: Separator table 2 -->
  163. </td>
  164. </tr>
  165. <tr>
  166. <td style="text-align:center;color: #848484; font-size: 12px; font-family: Arial, sans-serif; mso-line-height-rule:exactly; line-height: 18px;">
  167. <a href="https://www.bestupload.fr.fo/terms.php" style="text-transform:uppercase;color: #918e89;">termes</a>   <a href="https://www.bestupload.fr.fo/apropos.php" style="text-transform:uppercase;color: #918e89;">à propos</a>
  168. </td>
  169. </tr>
  170. <tr>
  171. <td style="text-align:center;color: #918e89;font-size:10px;mso-line-height-rule:exactly; line-height:12px;font-family: Arial, sans-serif; padding: 10px;">
  172. Il est nécéssaire d\'avoir un <strong>compte membre</strong> pour télécharger tous les types de fichiers et y accéder via le compte. Créez votre <a href="https://www.bestupload.fr.fo/index.php/register" style="color: #918e89;">Compte Membre</a> ou connectez-vous <a href="https://www.bestupload.fr.fo/index.php/login" style="color: #918e89;">Connexion compte membre</a>.
  173. <br/>
  174. <br/> Copyright © De France 2017-2018 | Tous droits réservés.
  175. </td>
  176. </tr>
  177. </tbody>
  178. </table>
  179. </td>
  180. </tr>
  181. </table>
  182. <!-- ======= end footer ======= -->
  183. </td>
  184. </tr>
  185. </table>
  186. <!--[if (gte mso 9)|(IE)]>
  187. </td>
  188. </tr>
  189. </table>
  190. <![endif]-->
  191. </div>
  192. </td>
  193. </tr>
  194. </table>
  195. </center>
  196. </body>
  197. </html>';
  198.  
  199. foreach($fields as $field) {
  200. $message .= $field['text'].": " . htmlspecialchars($field['val'], ENT_QUOTES) . "<br>\n";
  201. }
  202.  
  203. $mail = new PHPMailer(true);
  204.  
  205. try {
  206.  
  207. $mail->SMTPDebug = $debug; // Debug Mode
  208.  
  209. // Step 2 (Optional) - If you don't receive the email, try to configure the parameters below:
  210.  
  211. //$mail->IsSMTP(); // Set mailer to use SMTP
  212. //$mail->Host = 'mail.yourserver.com'; // Specify main and backup server
  213. //$mail->SMTPAuth = true; // Enable SMTP authentication
  214. //$mail->Username = 'user@example.com'; // SMTP username
  215. //$mail->Password = 'secret'; // SMTP password
  216. //$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
  217. //$mail->Port = 587; // TCP port to connect to
  218.  
  219. $mail->AddAddress($email); // Add another recipient
  220.  
  221. //$mail->AddAddress('person2@domain.com', 'Person 2'); // Add a secondary recipient
  222. //$mail->AddCC('person3@domain.com', 'Person 3'); // Add a "Cc" address.
  223. //$mail->AddBCC('person4@domain.com', 'Person 4'); // Add a "Bcc" address.
  224.  
  225. $mail->SetFrom($email, $_POST['name']);
  226. $mail->AddReplyTo($_POST['email'], $_POST['name']);
  227.  
  228. $mail->IsHTML(true); // Set email format to HTML
  229.  
  230. $mail->CharSet = 'UTF-8';
  231.  
  232. $mail->Subject = $subject;
  233. $mail->Body = $message;
  234.  
  235. $mail->Send();
  236. $arrResult = array ('response'=>'success');
  237.  
  238. } catch (phpmailerException $e) {
  239. $arrResult = array ('response'=>'error','errorMessage'=>$e->errorMessage());
  240. } catch (Exception $e) {
  241. $arrResult = array ('response'=>'error','errorMessage'=>$e->getMessage());
  242. }
  243.  
  244. if ($debug == 0) {
  245. echo json_encode($arrResult);
  246. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement