I have a flash form and a PHP sendmail script. I used a script from a source that I thought was reputable, but it doesn't work. It was strange in that it worked 'once' then nothing else. Can anyone see anything that I might have done wrong in these scripts?
Any help is appreciated!
Jason Kofoed
jasonkofoed@sbcglobal.net
Flash Form: (send button script)
the text input fields var properties are named:
'email', 'name' and 'message'
on (release) {
data.email = email;
data.name = name;
data.message = message;
data.loadVariables('sendmail.php', 'POST');
_parent.status = 'sending now ...';
}
PHP: "sendmail.php"
<?php
// and import them into the script
$name = $_POST[name];
$email = $_POST[mail];
$message = $_POST[message];
// where to send it
// ***** fixed recipient ******
$recip = "jasonkofoed@sbcglobal.net";
//**** end fixed recipient *******
// build up message
// this code for any multiline text fields
$message = str_replace("\r", "\n", $message);
// info vars
$sender = $_SERVER[REMOTE_ADDR];
// you can rearrange this - just do not add or remove quotes
$mailbody = "Contact form sent by
Name: $name
Email: $email
message:
$message
-------
sender's ip: $sender";
// send it off
mail($recip, "contact form", $mailbody, "From: webserver@esolutionsonline.com");
// and tell visitor
print "&status=mail sent - we will be in touch with you shortly&";
?>
Any help is appreciated!
Jason Kofoed
jasonkofoed@sbcglobal.net
Flash Form: (send button script)
the text input fields var properties are named:
'email', 'name' and 'message'
on (release) {
data.email = email;
data.name = name;
data.message = message;
data.loadVariables('sendmail.php', 'POST');
_parent.status = 'sending now ...';
}
PHP: "sendmail.php"
<?php
// and import them into the script
$name = $_POST[name];
$email = $_POST[mail];
$message = $_POST[message];
// where to send it
// ***** fixed recipient ******
$recip = "jasonkofoed@sbcglobal.net";
//**** end fixed recipient *******
// build up message
// this code for any multiline text fields
$message = str_replace("\r", "\n", $message);
// info vars
$sender = $_SERVER[REMOTE_ADDR];
// you can rearrange this - just do not add or remove quotes
$mailbody = "Contact form sent by
Name: $name
Email: $email
message:
$message
-------
sender's ip: $sender";
// send it off
mail($recip, "contact form", $mailbody, "From: webserver@esolutionsonline.com");
// and tell visitor
print "&status=mail sent - we will be in touch with you shortly&";
?>