Please Help me with my "contact form" Page, Can't get email

Discussion in 'Programming' started by SEO_Solutions, Jul 19, 2009.

Thread Status:
Not open for further replies.
  1. #1
    Hi,

    All, I just made a "contact Us" Page to my Web Directory at http://wqlj.com/contact.php

    all pages are done and live, but I have not received any Messages .

    I was sent many Messages by use this online form

    but I have not received any Messages so far.

    How to Fix this error? where does this Messages will go?

    Please help me .

    Thanks and have a nice day!

    Regards


    [PHP]<?php 
    require_once 'init.php'; 
    session_start(); 
    if (empty($_POST['submit'])) 
    { 
       if (!empty($_SERVER['HTTP_REFERER'])) 
          $_SESSION['return'] = $_SERVER['HTTP_REFERER']; 
       SmartyValidate :: connect($tpl); 
       SmartyValidate :: register_form('contact_form', true); 
       SmartyValidate :: register_criteria('isNotEqual', 'validate_not_equal', 'contact_form'); 
       SmartyValidate :: register_validator('v_name', 'name', 'notEmpty', false, false, false, 'contact_form'); 
       SmartyValidate :: register_validator('v_email', 'email', 'isEmail', false, false, false, 'contact_form'); 
       SmartyValidate :: register_validator('v_reason', 'reason:0', 'isNotEqual', true, false, false,  'contact_form'); 
       SmartyValidate :: register_validator('v_message', 'message', 'notEmpty', false, false, false, 'contact_form'); 
    } 
    else 
    { 
       SmartyValidate :: connect($tpl); 
       $data = array(); 
       $data['name'] = $_POST['name']; 
       $data['email'] = $_POST['email']; 
       $data['reason'] = $_POST['reason']; 
       $data['message'] = $_POST['message']; 
       if (SmartyValidate :: is_valid($data, 'contact_form')) 
       { 
          require_once 'libs/phpmailer/class.phpmailer.php'; 
          $mail = new PHPMailer(); 
          $mail->PluginDir = 'libs/phpmailer/'; 
          $mail->Mailer = 'mail'; 
          $mail->From = $data['email']; 
          $mail->FromName = $data['name']; 
          $mail->Subject = $data['reason']; 
          $mail->Body = $data['message']; 
          $mail->AddAddress('    ', '    '); 
          if (!$mail->Send()) 
          { 
             $tpl->assign('error', true); 
          } 
          else 
          { 
             $tpl->assign('success', true); 
          } 
          $mail->ClearAddresses(); 
       } 
    } 
    
    $path = array (); 
    $path[] = array ('ID' => '0', 'TITLE' => _L(SITE_NAME), 'TITLE_URL' => DOC_ROOT, 'DESCRIPTION' => ''); 
    $path[] = array ('ID' => '0', 'TITLE' => _L('Contact Us'), 'TITLE_URL' => '', 'DESCRIPTION' => _L('Contact Us')); 
    $tpl->assign($data); 
    $tpl->assign('path', $path); 
    
    echo $tpl->fetch('contact.tpl'); 
    ?>
    PHP:

    {capture name="title"} - {l}Contact Us{/l}{/capture}
    {capture assign="in_page_title"}{l}Contact Us{/l}{/capture}
    {capture assign="description"}{l}Contact us with queries you might have.{/l}{/capture}
    {include file="header.tpl"}
    {include file="top_bar.tpl"}
    {include file="admin/messages.tpl"}
    
    {if $error}
    <div class="err">
    {l}There was a problem sending the email. Please try again later.{/l}
    </div>
    
    
    
    {else}
    
    {if not $success}
    <form action="contact.php" method="post" name="contactform">
    <table border="0" cellspacing="10" class="formPage">
       <tr> 
       Please use this online form to send us your question or send an email to:- we'll get back to you with an answer within 24 hours.
        <td valign="top" align="right">Your Name:</td>
        <td>
    	<input type="text" name="name" value="{$name}" id="name" size="40" maxlength="100" class="text" /><br />
      	{validate form="contact_form" id="v_name" message=$smarty.capture.field_char_required}
    	</td>
      </tr>
      <tr> 
        <td valign="top" align="right">Your Email :</td>
        <td>
      	<input type="text" name="email" value="{$email}" id="email" size="40" maxlength="100" class="text" /><br />
      	{validate form="contact_form" id="v_email" message=$smarty.capture.invalid_email}
    	
    	</td>
      </tr>
      <tr> 
        <td valign="top" align="right">Subject:</td>
        <td>
    	
    			<select name="reason">
    			<option selected="selected"> - - select a contact reason - - </option>
    			<option value="advertising" label="advertising">Advertising Inquiry</option>
    			<option value="general" label="general">General Inquiry</option>
    			<option value="suggestion" label="category">New Category Suggestion</option>
    			<option value="other" label="other">Other (please specify)</option>
    			<option value="report" label="problem">Reporting a Problem</option>
    			<option value="feedback" label="feedback">Website Feedback</option>
    		</select>
    		{validate form="contact_form" id="v_reason" message=$smarty.capture.no_contact_reason}
    	
    	
    	</td>
      </tr>
      <tr> 
        <td valign="top" align="right">Message:</td>
        <td>
    	<textarea name="message" id="message" rows="5" cols="32" class="text">{$message}</textarea><br />
    	{validate form="contact_form" id="v_message" message=$smarty.capture.field_char_required}
    	</td>
      </tr>
      <tr> 
        <td>&nbsp;</td>
        <td><input type="submit" name="submit" value="Continue" class="btn" /></td>
      </tr>
    </table>
    </form>
    
    
    {else}
    <div class="msg">
    {l}Thank You, Your email has been sent.{/l}
    </div>
    
    
      {/if}
    {/if}{include file="footer.tpl"}
    PHP:
    [/PHP]
     
    SEO_Solutions, Jul 19, 2009 IP
Thread Status:
Not open for further replies.