change in servers

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
cdnmama
Forum Newbie
Posts: 5
Joined: Thu Jan 24, 2008 11:37 am
Location: Ontario, Canada

change in servers

Post 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
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: change in servers

Post 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.
(#10850)
cdnmama
Forum Newbie
Posts: 5
Joined: Thu Jan 24, 2008 11:37 am
Location: Ontario, Canada

Re: change in servers

Post 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);
Post Reply