Forum Replies Created

are often better for cooling We may not necessarily be buying the concept

  • This is the config file

    <?php
    /**
    * Setup mail server config
    */

    //where we would like to send email
    $recipientEmail = ‘info@in-beauty.co.uk’;
    $recipientName = ‘Yasmin Tornese’;

    //Address which will be visible in “From” field
    $fromEmail = ‘donotreply@mail.com’;
    $fromName = ‘Site Admnistrator’;

    //Validation error messages
    $requiredMessage = ‘Field is required’;
    $invalidEmail = ‘Invalid email’;

    /**
    * Advanced configuration – no need to modify
    */

    require_once(dirname(__FILE__) . ‘/vendor/ctPHPMailer.php’);
    $mail = new ctPHPMailer();

    //set your email address
    $mail->AddAddress($recipientEmail, $recipientName);
    $mail->SetFrom($fromEmail, $fromName);

    $debug = false; //if problems occur, set to true to view debug messages

    /**
    * For GMAIL configuration please use this values:
    *
    * $mail->Host = “smtp.gmail.com”; // SMTP server
    * $mail->Username = “mail@gmail.com”; // SMTP account username
    * $mail->Password = “yourpassword”; // SMTP account password
    * $mail->Port = 465; // set the SMTP port for the GMAIL server
    * $mail->SMTPSecure = “ssl”;
    *
    * More configuration options available here: https://code.google.com/a/apache-extras.org/p/phpmailer/wiki/ExamplesPage
    */

    /**
    * SERVER CONFIG
    */

    /**
    * Config for SMTP server – uncomment if you don’t want to use PHP mail() function
    **/

    /**
    * $mail->Host = “mail.yourdomain.com.”; // sets the SMTP server
    * $mail->Username = “username”; // SMTP account username
    * $mail->Password = “password”; // SMTP account password
    * $mail->SMTPAuth = true; // enable SMTP authentication – true if username and password required
    * $mail->Port = 587; // set the SMTP port (usually 587, or 465 when SSL)
    * $mail->IsSMTP(); uncomment it to enable smtp
    * $mail->SMTPDebug = $debug ? 2 : 0; // debug messages – set debug to false on production!
    */

    and this is the send.php

    <?php
    $ajax = (!empty($_SERVER[‘HTTP_X_REQUESTED_WITH’]) && strtolower($_SERVER[‘HTTP_X_REQUESTED_WITH’]) == ‘xmlhttprequest’);
    $ajax = true;
    //we do not allow direct script access
    if (!$ajax) {
    //redirect to contact form
    echo “Please enable Javascript”;
    exit;
    }
    require_once “config.php”;

    //we set up subject
    $mail->Subject = isset($_REQUEST[’email_subject’]) ? $_REQUEST[’email_subject’] : “Message from site”;

    //let’s validate and return errors if required
    $data = $mail->validateDynamic(array(‘required_error’ => $requiredMessage, ’email_error’ => $invalidEmail), $_REQUEST);

    //let’s make sure we have valid data
    //if (!$data[‘errors’] && (!isset($_REQUEST[‘js’]) || $_REQUEST[‘js’] != 1)) {
    //$data[‘errors’][‘global’] = ‘Javascript is required. Please try again’;
    //}

    if ($data[‘errors’]) {
    echo json_encode(array(‘errors’ => $data[‘errors’]));
    exit;
    }

    $html = ‘<body style=”margin: 10px;”>
    <div style=”width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;”>
    <h2>’ . $mail->Subject . ‘</h2>
    ‘;

    foreach ($data[‘fields’] as $label => $val) {
    $html .= ‘<p>’ . $label . ‘: ‘ . $val . ‘</p>’;
    }

    $html .= ‘</div></body>’;

    $mail->setup($html, $_REQUEST, array());

    $result = array(‘success’ => 1);
    if (!$mail->Send()) {
    $result[‘success’] = 0;
    }

    echo json_encode($result);
    exit;

    Hi Magda

    No your recommendation did not fix.

    The problem can be tested on the Looks Good download template !

    I have not altered any files relating to the form.

    Thanks

    Dino

    Hi Magda the added fields are altering all the layout and making unusable.
    Surely the form should work when purchased within the template ??

    Thanks

    Dino

    Hi this is the code for the form – what should i add ?? Thanks

    <form role=”form” action=”assets/form/send.php” form method=”post” class=”contactForm validateIt ct-u-paddingTop40″ data-email-subject=”Contact Form” data-show-errors=”true”>
    <div class=”form-group date ct-js-datetimePicker”>
    <label for=”dayTime2″ class=”control-label text-uppercase ct-u-fontSize14 ct-fw-600 ct-u-motiveColor ct-u-paddingBottom10″>preferred day:</label>
    <input type=”text” class=”form-control” placeholder=”Please choose a day” id=”dayTime2″ required>
    </div>
    <div class=”form-group”>
    <label for=”hourTime2″ class=”control-label text-uppercase ct-u-fontSize14 ct-fw-600 ct-u-motiveColor ct-u-paddingBottom10″>preferred time:</label>
    <select class=”ct-selectTime” id=”hourTime2″>
    <option> </option>
    <option value=”8″>08:00 am</option>
    <option value=”9″>09:00 am</option>
    <option value=”10″>10:00 am</option>
    <option value=”11″>11:00 am</option>
    <option value=”12″>12:00 am</option>
    <option value=”13″>13:00 pm</option>
    <option value=”14″>14:00 pm</option>
    <option value=”15″>15:00 pm</option>
    <option value=”16″>16:00 pm</option>
    <option value=”17″>17:00 pm</option>
    <option value=”18″>18:00 pm</option>
    <option value=”17″>19:00 pm</option>
    <option value=”18″>20:00 pm</option>
    </select>
    </div>
    <div class=”form-group”>
    <label class=”control-label text-uppercase ct-u-fontSize14 ct-fw-600 ct-u-motiveColor ct-u-paddingBottom10 ct-u-paddingTop10″>contact method:</label>
    <select class=”ct-selectContact”>
    <option> </option>
    <option value=”8″>Email</option>
    <option value=”9″>Text</option>
    <option value=”10″>Phone</option>
    </select>
    </div>
    <div class=”form-group”>
    <label for=”obs1″ class=”control-label text-uppercase ct-u-fontSize14 ct-fw-600 ct-u-motiveColor ct-u-paddingBottom10 ct-u-paddingTop10″>Comments:</label>
    <textarea class=”form-control ct-inputCode” rows=”4″ placeholder=”Include e-mail and phone number” id=”obs1″ required></textarea>
    </div>
    <div class=”text-center ct-u-paddingTop20″>
    <button type=”submit” class=”btn btn-default btn-sm btn-arrow”><span>request now</span></button>
    </div>
    </form>