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!
//Form information will be emailed on this Email address.
$to = "retrodog@comcast.net";
$email_body = "Please contact me at the email address below. Thank you!"."\n\n";
$email_body .= "Name: $name"."\n";
$email_body .= "Email Address: $email"."\n";
$mailheaders1 = "MIME-Version: 1.0\r\n";
$mailheaders1 .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$mailheaders1 .= "From: Christ Church\n";
$mailheaders1 .= "Reply-To: ecopeland@christchurch.com";
$mailheaders = "MIME-Version: 1.0\r\n";
$mailheaders .= "Content-type: text/plain; charset=iso-8859-1\r\n";
$mailheaders .= "From: $name \n";
$mailheaders .= "Reply-To: $email";
//And a copy to this email address
$cc = "";
//This will be the subject of email you will recieve on form submission
$subject = "I'm interested in learning more about Christ Church Fellowship";
//--------------------------------------------------//
//A Confirmation Email will be sent automatically to the user who will submit form,
//Write your Auto Email Subject below
$auto_subject = "Thank you for your interest in Christ Church";
//Write your Auto Email Body below
$auto_message = "As a member of Christ Church Fellowship, you will receive our regular email newsletter, Nexus, containing all the church news and updates. We will be contacting you shortly with more information. Thanks for your interest!!";
if(mail($to,$subject,stripslashes($email_body),$mailheaders)) {
//mail($cc,$subject,$email_body,"Reply-To: $email\r\n");
mail($email,$auto_subject,$auto_message,$mailheaders1);
header("Location: jump-in.php?msg=success");
exit;
}
else {
header("Location: jump-in.php?msg=issue");
exit;
}
I agree with feyd, you've probably written code that expects register_globals to be on. This is now turned off by default, and the current CVS version (soon to be PHP6) has completely removed the feature.
All of the variables that I use for the email are defined on the page as static text except for the $name and $email which are in the body of the email content. Hmmm. I used the GET on a different page to get some of the other variables but this just seems weird. All of the email components ($to, $subject., etc) are defined on the page.
retrodog wrote:All of the variables that I use for the email are defined on the page as static text except for the $name and $email which are in the body of the email content. Hmmm. I used the GET on a different page to get some of the other variables but this just seems weird. All of the email components ($to, $subject., etc) are defined on the page.
so you are saying only think changed is php4 to php5 and nothing else?
no server, no php.ini settings, nothing else at all...and mail() just does not work?
Well, the person I was in touch with at the new hosting company said that they had a php script that worked for sending out an email but then said that there was an ASP mail component that could be used if i wanted to use that...
Find out from the host what the mailing application is for you to be able to send emails from the PHP application. They should be able to tell you that and all the specifics you need to send mails. Unless it is Godaddy, in which case you may want to look for a different host (or switch to the Linux accounts instead of Windows).