Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Name: Contact Form
- Written by: Okler Themes - (http://www.okler.net)
- Theme Version: 6.0.0
- */
- session_cache_limiter('nocache');
- header('Expires: ' . gmdate('r', 0));
- header('Content-type: application/json');
- require_once('php-mailer/PHPMailerAutoload.php');
- // Step 1 - Enter your email address below.
- $email = 'bestupload2@gmail.com';
- // If the e-mail is not working, change the debug option to 2 | $debug = 2;
- $debug = 0;
- $subject = $_POST['subject'];
- $fields = array(
- 0 => array(
- 'text' => 'Name',
- 'val' => $_POST['name']
- ),
- 1 => array(
- 'text' => 'Email address',
- 'val' => $_POST['email']
- ),
- 2 => array(
- 'text' => 'Message',
- 'val' => $_POST['message']
- )
- );
- $message = '<html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
- <title>Formulaire de contact de BestUPLOAD</title>
- </head>
- <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">
- <center class="wrapper" style="width:100%;table-layout:fixed;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;background-color:#4d3e39">
- <table class="main" width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#4d3e39;" style="background-color:#4d3e39">
- <tr>
- <td class="full-width" style="width:100%">
- <div class="webkit" style="max-width:600px;margin:0 auto">
- <!--[if (gte mso 9)|(IE)]>
- <table width="600" align="center" cellpadding="0" cellspacing="0" border="0" style="border-spacing:0;font-family: Calibri, sans-serif;color:#333333;" >
- <tr>
- <td style="padding-top:0;padding-bottom:0;padding-right:0;padding-left:0;" >
- <![endif]-->
- <!-- ======= start main body ======= -->
- <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">
- <tr>
- <td class="no-padding" style="padding:0" bgcolor="#f3f0e6" style="color:#f3f0e6">
- <!-- ======= start header ======= -->
- <table class="header-content" style="margin:0 auto;min-height:160px" border="0" cellpadding="0" cellspacing="0" align="center">
- <tbody>
- <tr>
- <td align="center">
- <a class="full-width-image" href="https://www.bestupload.fr.fo" style="display:block;border:0!important;">
- <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" />
- </a>
- </td>
- </tr>
- </tbody>
- </table>
- <!-- ======= end article1 ======= -->
- <table border="0" cellpadding="20" cellspacing="0" width="100%" style="" bgcolor="#f3f0e6" style="color:#f3f0e6">
- <tr>
- <td class="one-column no-padding" bgcolor="#222222" style="border-spacing:0;padding:0">
- <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">
- '.$subject = $_POST["subject"].'
- </h1>
- <center>
- <table cellpadding="0" cellspacing="0" border="0" width="100%">
- <tbody>
- <tr>
- <td>
- <table border="0" align="center" cellpadding="0" cellspacing="0" style="Margin:0 auto;">
- <tbody>
- <tr>
- <td align="center">
- <table border="0" cellpadding="0" cellspacing="0" style="Margin:0 auto;">
- <tbody>
- <tr>
- <td align="center" bgcolor="#db7447" class="border-rounded width-150" style="-moz-border-radius:4px;-webkit-border-radius:4px;border-radius:4px">
- <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>
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- <table border="0" cellpadding="0" cellspacing="0">
- <tbody>
- <tr>
- <td class="full-width" style="font-size: 20px; height:20px; mso-line-height-rule:exactly; line-height: 20px;">
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </tbody>
- </table>
- </center>
- </td>
- </tr>
- <tr>
- <td class="content-text">
- <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>
- <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>
- <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Email: </span>'.$_POST["email"].'</p>
- <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>
- <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Sujet: </span>'.$_POST["subject"].'</p>
- <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Message: </span>'.$_POST["message"].'</p>
- <p style="margin-bottom: 10px; font-weight: normal; font-size: 18px;"><span style="font-weight: bold; color: #6d7279;">Fichier: </span>'.$_POST["file_1"].'</p>
- <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>
- </td>
- </tr>
- </table>
- <!-- ======= end article1 ======= -->
- <!-- ======= start footer ======= -->
- <table width="100%" cellpadding="0" cellspacing="0" border="0" bgcolor="#f3f0e6" style="color:#f3f0e6">
- <tr>
- <td class="one-column no-padding" style="border-spacing:0;padding:0">
- <table border="0" cellpadding="5" cellspacing="0" width="100%">
- <tbody>
- <tr>
- <td class="divider" style="height:10px!important;font-size:5px!important;mso-line-height-rule:exactly;line-height:5px!important"> </td>
- </tr>
- <tr>
- <td style="text-align:center;">
- <!-- Start: Separator table 1 -->
- <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
- <tr>
- <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>
- </tr>
- </table>
- <!-- End: Separator table 1 -->
- <!-- Start: Social -->
- <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>
- <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>
- <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>
- <!-- End: Social -->
- <!-- Start: Separator table 2 -->
- <table border="0" cellspacing="0" cellpadding="0" align="center" width="100%">
- <tr>
- <td class="divider" style="height:10px!important;font-size:5px!important;mso-line-height-rule:exactly;line-height:5px!important"> </td>
- </tr>
- <tr>
- <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>
- </tr>
- </table>
- <!-- End: Separator table 2 -->
- </td>
- </tr>
- <tr>
- <td style="text-align:center;color: #848484; font-size: 12px; font-family: Arial, sans-serif; mso-line-height-rule:exactly; line-height: 18px;">
- <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>
- </td>
- </tr>
- <tr>
- <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;">
- 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>.
- <br/>
- <br/> Copyright © De France 2017-2018 | Tous droits réservés.
- </td>
- </tr>
- </tbody>
- </table>
- </td>
- </tr>
- </table>
- <!-- ======= end footer ======= -->
- </td>
- </tr>
- </table>
- <!--[if (gte mso 9)|(IE)]>
- </td>
- </tr>
- </table>
- <![endif]-->
- </div>
- </td>
- </tr>
- </table>
- </center>
- </body>
- </html>';
- foreach($fields as $field) {
- $message .= $field['text'].": " . htmlspecialchars($field['val'], ENT_QUOTES) . "<br>\n";
- }
- $mail = new PHPMailer(true);
- try {
- $mail->SMTPDebug = $debug; // Debug Mode
- // Step 2 (Optional) - If you don't receive the email, try to configure the parameters below:
- //$mail->IsSMTP(); // Set mailer to use SMTP
- //$mail->Host = 'mail.yourserver.com'; // Specify main and backup server
- //$mail->SMTPAuth = true; // Enable SMTP authentication
- //$mail->Username = 'user@example.com'; // SMTP username
- //$mail->Password = 'secret'; // SMTP password
- //$mail->SMTPSecure = 'tls'; // Enable encryption, 'ssl' also accepted
- //$mail->Port = 587; // TCP port to connect to
- $mail->AddAddress($email); // Add another recipient
- //$mail->AddAddress('person2@domain.com', 'Person 2'); // Add a secondary recipient
- //$mail->AddCC('person3@domain.com', 'Person 3'); // Add a "Cc" address.
- //$mail->AddBCC('person4@domain.com', 'Person 4'); // Add a "Bcc" address.
- $mail->SetFrom($email, $_POST['name']);
- $mail->AddReplyTo($_POST['email'], $_POST['name']);
- $mail->IsHTML(true); // Set email format to HTML
- $mail->CharSet = 'UTF-8';
- $mail->Subject = $subject;
- $mail->Body = $message;
- $mail->Send();
- $arrResult = array ('response'=>'success');
- } catch (phpmailerException $e) {
- $arrResult = array ('response'=>'error','errorMessage'=>$e->errorMessage());
- } catch (Exception $e) {
- $arrResult = array ('response'=>'error','errorMessage'=>$e->getMessage());
- }
- if ($debug == 0) {
- echo json_encode($arrResult);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement