ljones
02-06-2008, 07:37 PM
I'm trying to use CyanBlue's email routine and cannot get it to work.
AS:
function sendMail () {
var email_lv = new LoadVars ();
email_lv.fromFname = targetTemp.from_fname;
email_lv.fromLname = targetTemp.from_lname;
email_lv.fromEmail = targetTemp.from_email;
email_lv.toFname = targetTemp.to_fname;
email_lv.toLname = targetTemp.to_lname;
email_lv.toEmail = targetTemp.to_email;
email_lv.toMessage = targetTemp.to_message;
email_lv.share = targetTemp.shareScore.value;
email_lv.subscribe = targetTemp.subscribe.value;
email_lv.onLoad = function (ok) {
if (ok) {
trace ("Email Sent!!!");
trace (unescape (this));
targetTemp.gotoAndStop ('mailSent');
} else {
trace ("Problem sending an Email!!!");
}
};
email_lv.sendAndLoad ("sendEmail.php",email_lv,"POST");
}
PHP:sendEmail.php
<?php
if ($_POST)
{
$mailTo = $_POST['toEmail'];
$mailSubject = "[Contact] Website Contact from - (" . $_POST['fromFname'] . ")";
$Header = "MIME-Version: 1.0\r\n";
$Header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$Header .= "From: " . $_POST['fromEmail'] . "\r\n";
$output = "<BR>";
$output .= "From : " . $_POST['fromFname'] . "<BR><BR>";
$output .= "Email : " . $_POST['fromEmail'] . "<BR><BR>";
$output .= "Message : " . $_POST['toMessage'] . "<BR><BR>";
$output = nl2br($output);
if (mail($mailTo, $mailSubject, stripslashes($output), $Header))
{
echo("&result=1&");
}
else
{
echo("&result=2&");
}
}
else
{
echo("This script runs only in Flash!!!");
}
?>
Thanks for your time.
AS:
function sendMail () {
var email_lv = new LoadVars ();
email_lv.fromFname = targetTemp.from_fname;
email_lv.fromLname = targetTemp.from_lname;
email_lv.fromEmail = targetTemp.from_email;
email_lv.toFname = targetTemp.to_fname;
email_lv.toLname = targetTemp.to_lname;
email_lv.toEmail = targetTemp.to_email;
email_lv.toMessage = targetTemp.to_message;
email_lv.share = targetTemp.shareScore.value;
email_lv.subscribe = targetTemp.subscribe.value;
email_lv.onLoad = function (ok) {
if (ok) {
trace ("Email Sent!!!");
trace (unescape (this));
targetTemp.gotoAndStop ('mailSent');
} else {
trace ("Problem sending an Email!!!");
}
};
email_lv.sendAndLoad ("sendEmail.php",email_lv,"POST");
}
PHP:sendEmail.php
<?php
if ($_POST)
{
$mailTo = $_POST['toEmail'];
$mailSubject = "[Contact] Website Contact from - (" . $_POST['fromFname'] . ")";
$Header = "MIME-Version: 1.0\r\n";
$Header .= "Content-type: text/html; charset=iso-8859-1\r\n";
$Header .= "From: " . $_POST['fromEmail'] . "\r\n";
$output = "<BR>";
$output .= "From : " . $_POST['fromFname'] . "<BR><BR>";
$output .= "Email : " . $_POST['fromEmail'] . "<BR><BR>";
$output .= "Message : " . $_POST['toMessage'] . "<BR><BR>";
$output = nl2br($output);
if (mail($mailTo, $mailSubject, stripslashes($output), $Header))
{
echo("&result=1&");
}
else
{
echo("&result=2&");
}
}
else
{
echo("This script runs only in Flash!!!");
}
?>
Thanks for your time.