Results 1 to 7 of 7

Thread: Contact agent email problem on 2.5.8

  1. #1
    Join Date
    Sep 2009
    Posts
    7

    Default Contact agent email problem on 2.5.8

    send and email from contact form is not working, after send a blank page appear and no email has been sent, in my server log errors everything is fine and "send a friend an email" works fine, any idea how to solve it?

    thank u very much in advance.

  2. #2
    Join Date
    Sep 2009
    Posts
    7

    Default Re: Contact agent email problem on 2.5.8

    other question...

    How can I do to establish that only the administrator can receive the mails sent by the contact agent form??

    Thanks

  3. #3
    Join Date
    Sep 2009
    Posts
    7

    Default Re: Contact agent email problem on 2.5.8

    This is my form, I need to solve it, what is wrong with it?

    PHP Code:
        function ContactAgentForm($listing_id 0$agent_id 0)
        {
            global 
    $conn$config$lang;
            require_once(
    $config['basepath'] . '/include/misc.inc.php');
            
    $misc = new misc();
            
    $display '';
            
    $error = array();
            
    $listing_id=intval($listing_id);
            
    $agent_id=intval($agent_id);
            if (
    $agent_id == 0) {
                if (
    $listing_id != 0) {
                    
    $sql_listing_id $misc->make_db_safe($listing_id);
                    
    $sql 'SELECT userdb_id FROM ' $config['table_prefix'] . 'listingsdb WHERE listingsdb_id = ' $sql_listing_id;
                    
    $recordSet $conn->Execute($sql);
                    if (
    $recordSet === false) {
                        
    $misc->log_error($sql);
                    }
                    
    $agent_id $misc->make_db_unsafe($recordSet->fields['userdb_id']);
                }
            }
            if (isset(
    $_POST['message'])) {
                
    // Make sure there is a message
                
    if( ($_SESSION['security_code'] != md5($_POST['security_code'])) && $config["use_email_image_verification"] == ) {
                    
    $error[] = 'email_verification_code_not_valid';
                }
                if (
    trim($_POST['name']) == '') {
                    
    $error[] = 'email_no_name';
                }
                if (
    trim($_POST['lastname']) == '') {
                    
    $error[] = 'user_editor_need_last_name';
                }            
                if (
    trim($_POST['phone']) == '') {
                    
    $error[] = 'email_no_phone';
                }                    
                if (
    trim($_POST['email']) == '') {
                    
    $error[] = 'email_no_email_address';
                }elseif (
    $misc->validate_email($_POST['email']) !== true) {
                    
    $error[] = 'email_invalid_email_address';
                }
                if (
    trim($_POST['subject']) == '') {
                    
    $error[] = 'email_no_subject';
                }
                if (
    trim($_POST['persons']) == '') {
                    
    $error[] = 'email_no_persons';
                }    
                if (
    trim($_POST['message']) == '') {
                    
    $error[] = 'email_no_message';
                }
            }
            if (
    count($error) == && isset($_POST['message'])) {
                
    // Grab Agents Email
                
    $sql_agent_id $misc->make_db_safe($agent_id);
                
    $sql 'SELECT userdb_emailaddress FROM ' $config['table_prefix'] . 'userdb WHERE userdb_id = ' $sql_agent_id;
                
    $recordSet $conn->Execute($sql);
                if (
    $recordSet === false) {
                    
    $misc->log_error($sql);
                }
                if (
    $config["include_senders_ip"] == 1) {
                    
    $_POST['message'] .= "\r\n" $lang['senders_ip_address'] . $_SERVER["REMOTE_ADDR"];
                }
                if (
    $recordSet->RecordCount() != 0) {
                    
    $emailaddress $misc->make_db_unsafe($recordSet->fields['userdb_emailaddress']);
                    
    // Send Mail
                    
    $sent $misc->send_email($_POST['name'], $_POST['lastname'], $_POST['email'], $emailaddress$_POST['phone'],$_POST['message'], $_POST['subject'],$_POST['persons'], $_POST['dates']);
                    if (
    $sent === true) {
                        
    $display .= $lang['email_listing_agent_sent'];
                    }else {
                        
    $display .= $sent;
                    }
                }
            }else {
                if (
    count($error) != 0) {
                    foreach (
    $error as $err) {
                        
    $display .= '<div class="error_text">' $lang[$err] . '</div>';
                    }
                }
                
    $name '';
                
    $lastname '';
                
    $email '';
                
    $phone '';            
                
    $subject '';
                
    $persons '';
                
    $dates '';

                if (
    $listing_id !== 0) {
                    
    $subject $lang['email_in_reference_to_listing'] . $listing_id;
                }
                
    $message '';
                if (isset(
    $_POST['message'])) {
                    
    $email stripslashes($_POST['email']);
                    
    $name stripslashes($_POST['name']);
                    
    $lastname stripslashes($_POST['lastname']);                
                    
    $phone stripslashes($_POST['phone']);                
                    
    $message stripslashes($_POST['message']);
                    
    $subject stripslashes($_POST['subject']);
                    
    $persons stripslashes($_POST['persons']);
                    
    $dates stripslashes($_POST['dates']);            
                }
                                    elseif (
    $k == 'date1') {
                        
                            
                            
    $datea$v$searchresultSQL .= '';}
                        elseif (
    $k == 'date2') {
                        
                            
    $dateb$v;
                            
    $searchresultSQL .= '';}        

                
    $display .= '<form name="contact_agent" method="post" action="index.php?action=contact_agent&amp;popup=yes&amp;listing_id=' $listing_id '&amp;agent_id=' $agent_id '">
                    <table  border="0" cellspacing="2" cellpadding="4">
                        <tr>
                            <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="name">' 
    $lang['user_manager_first_name'] . '&nbsp;&nbsp;</label>
                                <input id="name" name="name" value="' 
    htmlentities($name) . '" type="text" size="50">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="lastname">' 
    $lang['user_manager_last_name'] . '&nbsp;&nbsp;</label>
                                <input id="lastname" name="lastname" value="' 
    htmlentities($lastname) . '" type="text" size="50">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="phone">' 
    $lang['cap_phone'] . '&nbsp;&nbsp;</label>
                                <input id="phone" name="phone" value="' 
    htmlentities($phone) . '" type="number" size="20">
                            </td>
                        </tr>                    
                        <tr>
                            <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="email">' 
    $lang['email_your_email'] . '&nbsp;&nbsp;&nbsp;</label>
                                <input id="email" name="email" value="' 
    htmlentities($email) . '" type="email" size="50">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="subject">' 
    $lang['email_your_subject'] . '</label>
                                <input id="subject" name="subject" value="' 
    htmlentities($subject) . '" type="text" size="35">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="persons">' 
    $lang['cap_persons'] . '</label>
                                <input id="persons" name="persons" value="' 
    htmlentities($persons) . '" type="number" size="2">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="dates">' 
    $lang['email_your_dates'] . '</label>{addon_bookingcal_ortypesearch}
                            </td>
                        </tr>                
                        <tr>
                            <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="message">' 
    $lang['email_your_message'] . '</label>
                                <br />
                                <br />
                                <textarea id="message" name="message" rows="5" cols="50">' 
    htmlentities($message) . '</textarea>
                            </td>
                        </tr>'
    ;
                        if(
    $config["use_email_image_verification"] == ) {
                            
    $display .= '<tr>
                                <td colspan="2"><img src="'
    .$config['baseurl'].'/include/class/captcha/captcha_image.php" /></td>
                            </tr>
                            <tr>
                                <td colspan="2" style="vertical-align: top" class="TitleColor"><label for="security_code">' 
    $lang['email_verification_code'] . '</label>
                                    <input id="security_code" name="security_code" type="text" />
                                </td>
                            </tr>'
    ;
                        }
                        
    $display .= '<tr>
                            <td colspan="2"><input type="submit" name="Submit" value="' 
    $lang['email_send'] . '">
                            </td>
                        </tr>

                    </table>
                    </form>'
    ;
            } 

  4. #4
    Join Date
    May 2004
    Location
    Long Island, NY
    Age
    49
    Posts
    9,796

    Default Re: Contact agent email problem on 2.5.8

    If you are getting a blank page then there is an error somewhere and it should be recorded in your server error log (if you host has error logging turned on). Without seeing the actual error it is very hard for anyone to try and help and we would just be guessing.

    There is no way to have the emails sent to the admin only. The contact agent emails are sent to the agent. You would need an addon to replace the built in contact agent form. My contact form addon allows you to do this.

  5. #5
    Join Date
    Mar 2010
    Posts
    10

    Default Re: Contact agent email problem on 2.5.8

    did you fix the problem you posted? we have the same problem..may i know the solution if you do have..thanks so much..

  6. #6
    Join Date
    Jul 2010
    Posts
    1

    Wink Re: Contact agent email problem on 2.5.8

    I have that problem someone could solve it??

  7. #7
    Join Date
    Jul 2010
    Posts
    6

    Default Re: Contact agent email problem on 2.5.8

    you have to ask your hosting provider or you have to manually ad the domain to receive emails.

Similar Threads

  1. Contact an agent, email a friend problem. Please help
    By evridiki in forum Addon help, ideas and discussion (CLOSED)
    Replies: 1
    Last Post: 01-27-2009, 04:44 PM
  2. contact agent email issues
    By bighomebuyers.com in forum General Help (CLOSED)
    Replies: 4
    Last Post: 10-31-2008, 11:22 AM
  3. contact us page, agent email forwarded to main email
    By Gjozwiak in forum Installation/Configuration Help (CLOSED)
    Replies: 1
    Last Post: 04-25-2008, 01:18 PM
  4. Contact Agent email link
    By tooljob in forum General Help (CLOSED)
    Replies: 3
    Last Post: 04-19-2007, 08:22 AM
  5. Email Friend and Contact Agent
    By broomsy in forum General Help (CLOSED)
    Replies: 4
    Last Post: 12-06-2005, 08:19 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •