Can anyone help me with this script. It echos that an email was sent, but no email is going out. Any ideas. I would appreciate it...
<?php require_once('Connections/EMALL.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $HTTP_SERVER_VARS['PHP_SELF'];
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING'];
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "Newsletter")) {
$insertSQL = sprintf("INSERT INTO Emailcollector (`Email Address`, City, `State`, Status, `Shipping Address`, Zip) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['EmailAddress'], "text"),
GetSQLValueString($HTTP_POST_VARS['City'], "text"),
GetSQLValueString($HTTP_POST_VARS['State'], "text"),
GetSQLValueString(isset($HTTP_POST_VARS['Subscribe']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString($HTTP_POST_VARS['Address'], "text"),
GetSQLValueString($HTTP_POST_VARS['Zip'], "text"));
mysql_select_db($database_EMALL, $EMALL);
$Result1 = mysql_query($insertSQL, $EMALL) or die(mysql_error());
}
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "Newsletter")) {
$insertSQL = sprintf("INSERT INTO Emailcollector (`Email Address`, City, `State`, Status, `Shipping Address`, Zip) VALUES (%s, %s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['EmailAddress'], "text"),
GetSQLValueString($HTTP_POST_VARS['City'], "text"),
GetSQLValueString($HTTP_POST_VARS['State'], "text"),
GetSQLValueString(isset($HTTP_POST_VARS['Subscribe']) ? "true" : "", "defined","'Y'","'N'"),
GetSQLValueString($HTTP_POST_VARS['Address'], "text"),
GetSQLValueString($HTTP_POST_VARS['Zip'], "text"));
}
echo "Email Addy = $EmailAddress";
mail($EmailAddress, "AmericanEmall Newsletter", "Thank you for subscribing to our monthly newsletter. You will recieve the latest information on new products and much more. Stay tuned
To Unsubscribe, please click here: [url]http://www.stavalos.com/Email/remove.php?EmailAddress=[/url]$EmailAddress",
"From: [email]Newsletter@americanemall.com[/email]\r\n".
"Reply-To: [email]sales@americanemall.com[/email]\r\n".
"Return-Path: [email]sales@americanemall.com[/email]\r\n");
?>