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

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

  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?

    [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]

    Please help me .

    Thanks and have a nice day!

    Regards
     
    SEO_Solutions, Jul 19, 2009 IP
  2. syted

    syted Notable Member

    Messages:
    2,086
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    290
    #2
    Why does your sig link say PR6 when it's PR3?
     
    syted, Jul 19, 2009 IP
  3. thr3146

    thr3146 Active Member

    Messages:
    182
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    58
    #3
    What type script are you using?...php,cgi?
     
    thr3146, Jul 19, 2009 IP
  4. SEO_Solutions

    SEO_Solutions Peon

    Messages:
    118
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    It was updated by Google.
     
    SEO_Solutions, Jul 19, 2009 IP
  5. syted

    syted Notable Member

    Messages:
    2,086
    Likes Received:
    319
    Best Answers:
    0
    Trophy Points:
    290
    #5
    Aah OK, don't forget to update your sig link then.
     
    syted, Jul 19, 2009 IP
  6. jitendraag

    jitendraag Notable Member

    Messages:
    3,982
    Likes Received:
    324
    Best Answers:
    1
    Trophy Points:
    270
    #6
    Are you getting submission notifications? You might have to define in settings whether the emails should be sent using sendmail, phpmailer or SMTP server.
     
    jitendraag, Jul 19, 2009 IP
  7. SEO_Solutions

    SEO_Solutions Peon

    Messages:
    118
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #7
    PHP



    only "contact Us" form does not work in receive customers Message http://wqlj.com/contact.php


    THX
     
    SEO_Solutions, Jul 20, 2009 IP
  8. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #8
    Just a quick stab at it.

    try changing:

    $mail->AddAddress(' ', ' ');

    to

    $mail->AddAddress('PutYourEmail@here', 'Contact');

    Let us know how it goes.
     
    an0n, Jul 20, 2009 IP
    SEO_Solutions likes this.
  9. SEO_Solutions

    SEO_Solutions Peon

    Messages:
    118
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #9

    hi,
    an0n,Everything worked perfect!

    Thanks so much, Rep+ added :)
     
    SEO_Solutions, Jul 20, 2009 IP
  10. an0n

    an0n Prominent Member

    Messages:
    5,688
    Likes Received:
    915
    Best Answers:
    0
    Trophy Points:
    360
    #10
    Great!

    Glad it worked out :)

    R.
     
    an0n, Jul 20, 2009 IP