Page 1 of 1

change in servers

Posted: Tue Jan 29, 2008 5:41 pm
by cdnmama
Hello....my client was using this script for sharing her webpages. After her website was moved to my reseller account, the script stopped sending emails. My host support says no one there can take a look at the code. Can anyone see what might be wrong? The new server is using PHP Version: 4.4.7

Code: Select all

<?
 
$host = "www.DOMAIN.com";
$send = isset($_GET["send"]) ? true : false;
 
if($send) {
    if($_SERVER["SERVER_NAME"]==$host) {
        extract($_POST);
    
        foreach($FriendEmail AS $key=>$value) {
            $to = $value;
            $subject = "DOMAIN.com Recommended by a Friend";
            $body = "Hello,\r\n";
            $body .= "I visited the website http://www.DOMAIN.com and thought you would like to see this page. I hope you enjoy it as much as I did and will pass it on to others.\r\n";
            $body .= "\r\n";
            $body .= "$Referer\r\n";
            $body .= "\r\n";
            $body .= "Blessings,\r\n";
            $body .= "$Fullname\r\n";
            $xHeaders = "From: $Email\nX-Mailer: PHP/" . phpversion();
            mail ($to, $subject, $body, $xHeaders);
        }
    
    $msg = "Thank you $Fullname! Your friends should be receiving their e-mail shortly.";
    }
}
 
require("includes/share.html");
?>
The only thing I did to the code was take out the domain name. Thanks for looking :)

Deb

Re: change in servers

Posted: Tue Jan 29, 2008 6:24 pm
by Christopher
I assume that you have change it to "DOMAIN.com".

Does is display the "Thank you $Fullname! Your friends should be receiving their e-mail shortly." message?

Probably mail() is not configured correctly.

Re: change in servers

Posted: Tue Jan 29, 2008 6:50 pm
by cdnmama
arborint wrote:I assume that you have change it to "DOMAIN.com".
the code I use on the website is using the actual domain name...I just changed the client's domain name to DOMAIN for this forum
arborint wrote:Does is display the "Thank you $Fullname! Your friends should be receiving their e-mail shortly." message?
I don't know....I haven't been able to receive an email from this script
arborint wrote:Probably mail() is not configured correctly.
Do you mean this line?

Code: Select all

mail ($to, $subject, $body, $xHeaders);