Page 1 of 1

PHP Form mailer problem Please help a Noob

Posted: Sat Apr 05, 2008 4:56 pm
by flyinfella
Hello Everyone,

I have created a PHP mailer following a tutorial I found online. I know very little about coding, BUT I did get this exact code to work on a friends site, who is hosted by "Go Daddy". This code below is identical except for the e-mail addresses, but will not send any e-mails with my hosing provider. They did say they had three requirements that was their most common source for problems.

1. Must be a paid hosting account, Which I have.

2. Header must be complete, to, from, subject. Which I think I have done.

3. One of the two e-mail addresses must be hosted on their server. The address listed is.

Here is the script I used.

Code: Select all

<?PHP 
$to = "holisticarts@yahoo.com";
$from = "christie@holisticarts.net"; 
$subject = "Holistic Arts Info Request";
$forward = 0;
$location = "";
 
$date = date ("l, F jS, Y"); 
$time = date ("h:i A"); 
 
 
 
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.\n\n"; 
 
if ($_SERVER['REQUEST_METHOD'] == "POST") {
    foreach ($_POST as $key => $value) { 
        $msg .= ucfirst ($key) ." : ". $value . "\n"; 
    }
}
else {
    foreach ($_GET as $key => $value) { 
        $msg .= ucfirst ($key) ." : ". $value . "\n"; 
    }
}
 
mail($to, $from, $subject, $msg); 
if ($forward == 1) { 
    header ("Location:$location"); 
} 
else { 
    echo "Thank you for contacting us. We will get back to you as soon as possible. Namaste."; 
} 
 
?>
This did not work. The html portion can be viewed at holisticarts.net on the contact page.

Then I tried a test script provided my the hosing company. It is listed below.

Code: Select all

<?
$from = "Holistic Arts";
$to = "christie@holisticarts.net";
$subject = "Hi 2 ";
$body = "TEST Vic";
 
if(mail($to,$subject,$body,$from)) echo "MAIL - OK";
else echo "MAIL FAILED";
?>
This is what is loaded on the server now as mailer.php, it also does not work. I get the "MAIL - OK" after filling out the form, so I think the html is correctly referencing the PHP file, but I do not know where to turn from here. Sorry for the lengthy post, but I wanted to be as specific as I could.

Thanks for your time in advance,
Victor

Re: PHP Form mailer problem Please help a Noob

Posted: Sat Apr 05, 2008 5:02 pm
by flyinfella
Ok. so after all that. I got a reply from my hosing company inquiry.
Hello,

The reason for this situation is that we are currently experiencing a global server issue that will be fixed as soon as possible by our system administrators. Excuse us for the inconvenience caused!
I hope this does not take to long, because I have been stressing over this script for over two weeks! Do you guys think this reply I got is legit? or are they just trying to get me off their backs?

Thanks Again,
Victor