I have universal email but when using the "Security assist email password behavior " it does not use mail.php and that is why I think I am having an issue. Can you explain how to change the below code. thank you.
<?php require_once('../Connections/acadia_mh.php');?>
<?php require_once("../WA_SecurityAssist/WA_SHA1Encryption.php"); ?>
<?php require_once( "../WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
require_once("../WA_SecurityAssist/WA_RandomPassword.php");
?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php");
?>
<?php
if (!WA_Auth_RulePasses("Administrator")){
WA_Auth_RestrictAccess("../access_denied.php");
}
?>
<?php
if (!session_id()) session_start();
if(isset($_POST["Send_x"])) {
$_SESSION["NewPW"] = "".WA_RandomPassword(8, true, true, true, "") ."";
}?>
<?php
// WA Application Builder Update
if (isset($_POST["Send_x"])) // Trigger
{
$WA_connection = $acadia_mh;
$WA_table = "visitors";
$WA_redirectURL = "";
$WA_keepQueryString = false;
$WA_indexField = "UserEmail";
$WA_fieldNamesStr = "UserPassword";
$WA_fieldValuesStr = "".WA_SHA1Encryption($_SESSION['NewPW']) ."";
$WA_columnTypesStr = "',none,''";
$WA_comparisonStr = "=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".((isset($_POST["emailAddress"]))?$_POST["emailAddress"]:"") ."";
$WA_where_columnTypesStr = "',none,''";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);
$WA_connectionDB = $database_acadia_mh;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<?php
function WA_SecurityAssist_Email_1_SendMail($WA_Auth_Parameter){
$WA_MailObject = WA_SecurityAssist_Definition("mail.acadia-auctions.com ","587","webmaster@acadia-auctions.com","","","");
$WA_MailObject = WA_SecurityAssist_SendMail($WA_MailObject,"","","",$WA_Auth_Parameter["toAddress"],"",$WA_Auth_Parameter["fromAddress"],$WA_Auth_Parameter["subject"],$WA_Auth_Parameter["mailBody"]);
$WA_MailObject = null;
}// WA_SecurityAssist_Email_1_SendMail
?>
<?php
if(isset($_POST["Send_x"])){
//WA SecurityAssist Email object="Mail for Linux"
$WA_Auth_Parameter = array(
"connection" => $acadia_mh,
"database" => $database_acadia_mh,
"tableName" => "visitors",
"filterColumn" => "UserEmail",
"columnValue" => "".((isset($_POST["emailAddress"]))?$_POST["emailAddress"]:"") ."",
"columnType" => "text",
"usernameColumn" => "UserUserName",
"passwordColumn" => "UserPassword",
"selectColumns" => array("UserFirstName","UserLastName"),
"sessionVariables" => array("NewPW"),
"successRedirect" => "credentials_sent.php",
"failRedirect" => "error.php",
"keepQueryString" => TRUE,
"toAddress" => "UserEmail",
"toAddress" => "bryan@squeakywheeladventures.org",
"fromAddress" => "info@acadia-auctions.com",
"fromAddressDisplay" => "Acadia Auto Auctions",
"subject" => "Your Acadia Auto Auction Website Account Information",
"mailBody" => "Dear [UserFirstName] [UserLastName],\n<BR>\n<BR>\nXXXXXXX",
"emailFunction" => "WA_SecurityAssist_Email_1_SendMail"
);
WA_Auth_ForgotPassword($WA_Auth_Parameter);
}
?>