Tutorial

This has been present ever since Dolphin 6.1x came out, possibly even prior to 6.1.

If someone sends you an email using the contact form...yoursite.com/contact.php you receive the message to the email address you specified during installation.

The problem is when you receive it the return address will be from your Dolphin site.

This means if you reply to it, the message will send right back to the email address you are using for your website. The user that originally sent you the message will not receive it.

Easy Test:

Just go to your contact page and send a message. When your receive the message try to reply to it. If the (to:) address is the address of your site, it is not going to actually send it to the member or anyone else who uses this contact form. When you send, it will come right back to you instead.

If you have this problem you can simply download this contact.php for version 6.1x already modified to resolve this problem. Simply drop it in your main Dolphin directory such as yoursite.com/contact.php overwriting the original. Be sure to backup your original contact.php first.

Now refresh your page/site in your browser. Then, visit yoursite.com/contact.php again. Send yourself a new message and when you receive it reply back.

 

If this doesn't affect you than no need to perform any modifications below.

*Note if the submit button does not do anything the second time you may have to clear your cache, cookies, or simply close your browser and open a new session to re-test. This is usually the case and present with mozilla/Firefox. So keep this in mind. It's not the modification it's because you already recently used the contact form. You must clear out the temp/cache/etc to re-test.

If all is well the (to:) address should now reflect the original senders address, and when you send it they actually receive it like they should.

As far as I know of this bug still exists, and is present in all 6.1x versions. Simply send yourself a test contact mail first and after to verify.

You can download the already modified contact.php for version 6.1x here to save yourself some time, or if you are unsure. Simply unzip contact.php, then upload to your main Dolphin directory...yoursite.com/contact.php overwriting the original. Be sure to backup the original contact.php just in case.

If you prefer to manually edit the file yourself backup your original contact.php and apply the following changes to the file:

To Manual edit open contact.php
 
Find:

            if( sendMail( $site['email'], $sLetterSubject, $sLetterBody ) )

Change to:
            if( sendMail2( $site['email'], $sLetterSubject, $sLetterBody, $sSenderEmail) )


Then find near the bottom:

    </form>
    <?
    $ret = ob_get_clean();

    return DesignBoxContent( _t( "_CONTACT_H1" ), $ret, $oTemplConfig -> PageCompThird_db_num);
}

?>



Change to:

    </form>
    <?
    $ret = ob_get_clean();

    return DesignBoxContent( _t( "_CONTACT_H1" ), $ret, $oTemplConfig -> PageCompThird_db_num);
}
function sendMail2( $sRecipientEmail, $sMailSubject, $sMailBody, $sSenderEmail, $iRecipientID = '', $aPlus = '', $sNNBuyer = '', $sEMLBuyer = '' )
{
    global $site;

    if( $iRecipientID )
        $aRecipientInfo = getProfileInfo( $iRecipientID );

    $sMailHeader        = "From:<" . $sSenderEmail . ">";
    $sMailParameters    = "-f{$site['email_notify']}";


    $sMailSubject    = str_replace( "<SiteName>", $site['title'], $sMailSubject );

    $sMailBody        = str_replace( "<SiteName>", $site['title'], $sMailBody );
    $sMailBody        = str_replace( "<Domain>", $site['url'], $sMailBody );
    $sMailBody        = str_replace( "<recipientID>", $aRecipientInfo['ID'], $sMailBody );
    $sMailBody        = str_replace( "<RealName>", $aRecipientInfo['NickName'], $sMailBody );
    $sMailBody        = str_replace( "<NickName>", $aRecipientInfo['NickName'], $sMailBody );
    $sMailBody        = str_replace( "<Email>", $aRecipientInfo['Email'], $sMailBody );

if ($sNNBuyer!='')
                $sMailBody        = str_replace( "<NickNameB>", $sNNBuyer, $sMailBody );
                if ($sEMLBuyer!='')
                $sMailBody        = str_replace( "<EmailB>", $sEMLBuyer, $sMailBody );
                $sMailBody        = str_replace( "<Password>", $aRecipientInfo['PW'], $sMailBody );



    if( is_array($aPlus) )
    {
        foreach ( $aPlus as $key => $value )
        {
            $sMailBody = str_replace( '<' . $key . '>', $value, $sMailBody );
        }
    }

   
   
    if( 'HTML' == $aRecipientInfo['EmailFlag'])
    {
        $sMailHeader = "MIME-Version: 1.0\r\n" . "Content-type: text/html; charset=UTF-8\r\n" . $sMailHeader;
        $iSendingResult = mail( $sRecipientEmail, $sMailSubject, $sMailBody, $sMailHeader, $sMailParameters );
    }
    else
    {
        $iSendingResult = mail( $sRecipientEmail, $sMailSubject, html2txt($sMailBody), $sMailHeader, $sMailParameters );
    }

    return $iSendingResult;
}
?>

 
Written By
Tutorial by: Jeremy LeSarge (AKA Ray)

I am the owner and administrator of DialMe.com. I write Tutorials for Boonex Dolphin as well as tips and resources surrounding website programming and development. I enjoy working with WordPress, SEO, and Web Hosting / Servers. I also maintain a WordPress Blog here on this site where you will find a variety of technology and webmaster resources.

Actions
Sponsored Links
Recommend