The "Freeola Customer Forum" forum, which includes Retro Game Reviews, has been archived and is now read-only. You cannot post here or create a new thread or review on this forum.
Here is the script :-
function sendmail()
{
global $mail_to, $mail_from_name, $mail_from_email; $mail_body;
$mail_parts["mail_to"] = $mail_to;
$mail_parts["mail_from_name"] = $mail_from_name;
$mail_parts["mail_from_email"] = $mail_from_email;
$mail_parts["mail_body"] = $mail_body;
$mail_to = [email protected]
if(my_mail($mail_parts))
user_message("Successfully sent an e-mail title '$mail_subject'.");
else error_message("An unknown error occurred while attempting to send an e-mail title '$mail_subject'.");
}
function my_mail($mail_parts)
{
$mail_from = $mail_parts["mail_from_name"];
$mail_body = $mail_parts["mail_body"];
if(empty($mail_to)) error_message("Empty to field!");
if(empty($mail_body)) error_message("No message!");
$mail_to = str_replace("; ", ",", $mail_to);
$mail_headers = '';
$mail_subject = stripsplashes($mail_subject);
$mail_body = stripslashes($mail_body);
return mail ($mail_body);
}
?>
This is the page where users can send the feedback:-
http://wallpapers.mega.net.kg/feedback/
Any suggestions would be helpful, cheers.
By the way, I know the site looks complete crap on Netscape, I'm in the middle of sorting that :).
============================================================
mail($mail_to, "Feed Back Form Results",
"FROM: $mail_from_name ($mail_from_email) $mail_body"
", "FROM:$mail_from_email");
print "Feed back has been sent, thank you.
\n\n";
============================================================
is all you really need, none of the other code that you have written. Just copy that code into say Send_Feedback.php and it will do what you after, although right now it doesn't validate it to make sure people fill in all 3 fields, you may also want to add on more line at the bottom to link back somewhere, like:
print "You may return to my Home Page";
Go to www.php.net/mail , it's very self-explanatory.
This is the updated script.
function sendmail()
{
global $mail_to, $mail_from_name, $mail_from_email; $mail_body;
$mail_to = '[email protected]';
$mail_parts["mail_to"] = $mail_to;
$mail_parts["mail_from_name"] = $mail_from_name;
$mail_parts["mail_from_email"] = $mail_from_email;
$mail_parts["mail_body"] = $mail_body;
mail($mail_to, "Feed Back Form Results",
"FROM: $mail_from_name ($mail_from_email) $mail_body";
", "FROM:$mail_from_email");
print "Feed back has been sent, thank you.
";
}
function my_mail($mail_parts)
{
$mail_from = $mail_parts["mail_from_name"];
$mail_body = $mail_parts["mail_body"];
if(empty($mail_to)) error_message("Empty to field!");
if(empty($mail_body)) error_message("No message!");
$mail_to = str_replace("; ", ",", $mail_to);
$mail_headers = '';
$mail_subject = stripsplashes($mail_subject);
$mail_body = stripslashes($mail_body);
return mail ($mail_body);
}
?>
The commands you told me to insert might not be in the right place though. I don't really know what I'm doing.
Thanks a lot cjh.
"FROM: $mail_from_name ($mail_from_email) $mail_body"
", "FROM:$mail_from_email");
Will work fine, you can just use that bit of code to seny you the mail, you might want to add:
print "Feed back has been sent, thank you.
";
after the top bit of code.
This will just send you the feedback and put a 'thank you' on the page, but it won't validate it or anythin like you have tried to do, as I didn't really understand some of that at the bottom :o)