I don't receive emails from contact page?

Discussion in 'Real Photography WordPress Theme' started by brackenburns, Aug 26, 2014.

  1. brackenburns

    brackenburns New Member

    Joined:
    Jun 26, 2012
    Messages:
    2
    Likes Received:
    0
    I am using the contact page template on my site: www.blahzaycreative.com. But I don't ever receive the emails....

    I haven't done anything to the original code:


    <?php
    /*
    Template Name: Contact Page
    */
    ?>
    <?php
    $nameError = '';
    $emailError = '';
    $commentError = '';
    if (isset($_POST['submitted'])) {
    if (trim($_POST['contactName']) === '') {
    $nameError = 'Please enter your name.';
    $hasError = true;
    } else {
    $name = trim($_POST['contactName']);
    }
    if (trim($_POST['email']) === '') {
    $emailError = 'Please enter your email address.';
    $hasError = true;
    } else if (!eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}$", trim($_POST['email']))) {
    $emailError = 'You entered an invalid email address.';
    $hasError = true;
    } else {
    $email = trim($_POST['email']);
    }
    if (trim($_POST['comments']) === '') {
    $commentError = 'Please enter a message.';
    $hasError = true;
    } else {
    if (function_exists('stripslashes')) {
    $comments = stripslashes(trim($_POST['comments']));
    } else {
    $comments = trim($_POST['comments']);
    }
    }
    if (!isset($hasError)) {
    $emailTo = get_option('tz_email');
    if (!isset($emailTo) || ($emailTo == '')) {
    $emailTo = get_option('admin_email');
    }
    $subject = '[PHP Snippets] From ' . $name;
    $body = "Name: $name \n\nEmail: $email \n\nComments: $comments";
    $headers = 'From: ' . $name . ' <' . $emailTo . '>' . "\r\n" . 'Reply-To: ' . $email;
    mail($emailTo, $subject, $body, $headers);
    $emailSent = true;
    }
    }
    ?>
    <?php get_header(); ?>
    <script>
    jQuery(document).ready(function(){
    jQuery("#contactForm").validate();
    });
    </script>
    <div class="page-wrapper">
    <div class="eleven columns alpha">
    <div class="page-bar">
    <h1 class="page_title"><?php the_title(); ?></h1>
    <div class="contact-page">
    <?php if (have_posts()) : the_post(); ?>
    <?php endif; ?>
    <?php the_content(); ?>
    <?php if (isset($emailSent) && $emailSent == true) { ?>
    <div class="thanks">
    <p>Thanks, your email was sent successfully.</p>
    </div>
    <?php } else { ?>
    <?php if (isset($hasError) || isset($captchaError)) { ?>
    <?php } ?>
    <form action="<?php the_permalink(); ?>" id="contactForm" class="contactform" method="post">
    <label for="contactName">Name <span class="required">(required)</span>:</label>
    <input type="text" name="contactName" id="contactName" value="<?php if (isset($_POST['contactName']))
    echo $_POST['contactName']; ?>" class="text required requiredField" />
    <?php if ($nameError != '') { ?>
    <span class="error"> <?php echo $nameError; ?> </span>
    <?php } ?>
    <br/>
    <label for="email">Email <span class="required">(required)</span>:</label>
    <input type="text" name="email" id="email" value="<?php if (isset($_POST['email']))
    echo $_POST['email']; ?>" class="text required requiredField email" />
    <?php if ($emailError != '') { ?>
    <span class="error"> <?php echo $emailError; ?> </span>
    <br/>
    <?php } ?>
    <br/>
    <label class="label" for="commentsText">Message <span class="required">(required)</span>:</label>
    <textarea name="comments" id="commentsText" rows="20" cols="30" class="required requiredField message"><?php if (isset($_POST['comments'])) { if (function_exists('stripslashes')) {echo stripslashes($_POST['comments']);} else {echo $_POST['comments']; } }?> </textarea>
    <?php if ($commentError != '') { ?>
    <span class="error"> <?php echo $commentError; ?> </span>
    <br/>
    <?php } ?>
    <br/>
    <input class="btnSubmit" type="submit" name="submit" value="SEND"/>
    <input type="hidden" name="submitted" id="submitted" value="true" />
    </form>
    <?php } ?>
    </div>
    </div>
    </div>
    <div class="five columns omega">
    <!--Start Sidebar-->
    <?php get_sidebar(); ?>
    <!--End Sidebar-->
    </div>
    </div>
    <?php get_footer(); ?>
     
  2. Yogesh

    Yogesh Guest

    Joined:
    Aug 8, 2014
    Messages:
    2,052
    Likes Received:
    41
    Hello,

    We checked the email functionality in our theme, it is working fine.
    Please provide right email in your dashboard to get email.
    See screenshot for help.

    That will resolve your issue.

    Thanks & Regards
    Yogesh Bhade
     

    Attached Files:

Share This Page