(Another) PHP Mail not Sending...

Discussion in 'HTML / PHP / JavaScript / CSS' started by lukesb, May 7, 2010.

  1. Hi

    I'm having no luck getting my PHP email sending to work. I have pasted the code below. If any one could help I'd really appreciate it..!

    HTML:
    <div class="container">
        <div id="contactFormContainer">
            <div id="contactForm">
            	<div class="loader"></div>
    			<div class="bar"></div>
                <form action="mail.php" class="contactForm" name="cform" method="post">
                    <p>Talk to us about anything. If you have any feedback, ideas, or <br />there is anything else you want to say, we&rsquo;ll get back to you shortly.</p>
                    <div class="input_boxes">
                        <p><label for="name">Name</label><span class="name-missing">Please enter your name...</span><br />
                        <input id="name" type="text" value="" name="name" /></p>
                        <p><label for="e-mail">E-mail</label><span class="email-missing">Please enter a valid e-mail...</span><br />
                        <input id="e-mail" type="text" value="" name="email" /></p>
                        <p><label for="message">Feedback</label><span class="message-missing">Tell us your thoughts...</span><br />
                        <textarea id="message" rows="" cols="" name="message"></textarea></p>
                     </div>   
                     <input class="submit" type="submit" name="submit" value="Submit Form" onfocus="this.blur()"  />
                </form>
          </div>
          <div class="contact"></div>    
      </div>
    mail.php
    PHP:
    <?php
    //variables
    $name $_POST['name'];
    $email $_POST['email'];
    $message nl2br($_POST['message']);
    //date
    $todayis date("l, F j, Y, g:i a") ;
    //set title
    $subject "Message from Your Website";
    $body "From $name, \n\n$message";
    $headers 'From: '.$email.'' "\r\n" .
        
    'Reply-To: '.$email.'' "\r\n" .
        
    'Content-type: text/html; charset=utf-8' "\r\n" .
        
    'X-Mailer: PHP/' phpversion();

    //email address
    mail("[email protected]"$subject$body$headers);
    ?>
    <!--Display a thankyou message in the callback -->
    <div id="mail_response">
        <h3>Thank you <?php echo $name ?>!</h3><br />
        <p>We will answer your message soon as possible.</p><br /><br /><br />
        <h5>Message sent on: </h5>
        <p><?php echo $todayis ?></p>
    </div>  
    I don't get any error messages, it just doesn't send the mail or pass on the sent message...

    Cheers..!

    Luke
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    If you didn't get any error, it is very difficult to troubleshoot without getting more details.

    I think you should open a support ticket.
     

Share This Page