View Full Version : Simple php script not working
04-02-2007, 08:43 AM
This code is being called from a flash form. It doesn't work on this server, but it works on a different server, how come? Please help, thanks.
$to = "firstname.lastname@example.org";
$msg = "Name: $name\n\n";
$msg .= "Email: $email\n\n";
$msg .= "Phone: $phone\n\n";
$msg .= "Location: $location\n\n";
$msg .= "Comment:\n $message\n\n";
mail($to, $subject, $msg, "From: $email\nReply-To: $email\n");
04-02-2007, 09:49 AM
the from email has to actually exist in cPanel.
04-02-2007, 10:08 AM
what do you mean exist in cpanel? the from email being parsed is the user's email he's inputting in the flash form? If you're referring to the "to" email being myemail@myserver, I changed that particularly for this topic just to not post my private email.
04-02-2007, 10:13 AM
I mean exactly what I said. The from email has to be from an email off of your account. The reply to address can be the users email address or just include his email address in the message so you know who it was from.
04-02-2007, 11:28 AM
$to = ‘email@example.com’;
$subject = ‘Subject’;
$message = ‘This is a test’;
$headers = ‘From: firstname.lastname@example.org’ . “rn” .
‘Reply-To: email@example.com’ . “rn” .
‘X-Mailer: PHP/’ . phpversion();
mail($to, $subject, $message, $headers);
The $headers string would modified to be inputted by sender.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.