",$Text) or die("neither text nor html part present."); $Text=$Text?$Text:"Sorry, but you need an html mailer to read this mail."; $From or die("sender address missing"); $To or die("recipient address missing"); $headers ="MIME-Version: 1.0\r\n"; $headers.="From: ".$FromName." <".$From.">\n"; $headers.=($ToName)? "To: ". $ToName ." <".$To.">\n":""; $headers.="Cc: ".$FromName." <".$From.">\n"; $headers.="Reply-To: ".$FromName." <".$From.">\n"; $headers.="X-Priority: 1\n"; $headers.="X-MSMail-Priority: High\n"; $headers.="X-Mailer: My PHP Mailer\n"; $headers.="Content-Type: multipart/mixed;\n\tboundary=\"".$OB."\"\n"; //Messages start with text/html alternatives in OB $Msg ="This is a multi-part message in MIME format.\n"; $Msg.="\n--".$OB."\n"; $Msg.="Content-Type: multipart/alternative;\n\tboundary=\"".$IB."\"\n\n"; //plaintext section $Msg.="\n--".$IB."\n"; $Msg.="Content-Type: text/plain;\n\tcharset=\"iso-8859-1\"\n"; $Msg.="Content-Transfer-Encoding: quoted-printable\n\n"; // plaintext goes here $Msg.=$Text."\n\n"; // html section $Msg.="\n--".$IB."\n"; $Msg.="Content-Type: text/html;\n\tcharset=\"iso-8859-1\"\n"; $Msg.="Content-Transfer-Encoding: base64\n\n"; // html goes here $Msg.=chunk_split(base64_encode($Html))."\n\n"; // end of IB $Msg.="\n--".$IB."--\n"; // attachments if($AttmFiles){ foreach($AttmFiles as $AttmFile) { $patharray = explode ("/", $AttmFile); $FileName=$patharray[count($patharray)-1]; $Msg.= "\n--".$OB."\n"; $Msg.="Content-Type: application/octetstream;\n\tname=\"".$FileName."\"\n"; $Msg.="Content-Transfer-Encoding: base64\n"; $Msg.="Content-Disposition: attachment;\n\tfilename=\"".$FileName."\"\n\n"; //file goes here $fd=fopen ($AttmFile, "r"); $FileContent=fread($fd,filesize($AttmFile)); fclose ($fd); $FileContent=chunk_split(base64_encode($FileContent)); $Msg.=$FileContent; $Msg.="\n\n"; } } //message ends $Msg.="\n--".$OB."--\n"; mail($To,$Subject,$Msg,$headers); } ///////////////////////////////////////////////////////// ///////////////////////////////////////////////////////// //print_r($_REQUEST); //echo "

"; ///////////////////////////////////////////////////////// //$var_WebSite = $_REQUEST['web']; //no longer used $var_Database = "bstapps_DBPass".$_REQUEST['brt82']; $var_CustomerEmail = $_REQUEST['email']; $var_SOSstart = $_REQUEST['SOSstart']; $var_ID = $_REQUEST['ar']; ///////////////////////////////////////////////////////// $var_Date = date('Y-m-d'); ///////////////////////////////////////////////////////// //$var_EmailVerify = 'Location:http://'.$var_WebSite; //no longer used $var_EmailVerify = 'Location:http://www.bstapps.com/EmailVerify/EmailVerifySuccess.html'; //this is the live verify email //$var_EmailVerify = 'Location:https://www.bstapps.com/programer/EmailVerify/EmailVerifySuccess.html'; //this is the test verify email ///////////////////////////////////////////////////////// $var_SOSVerify = 'Location:http://www.bstapps.com/EmailVerify/SosStartSuccess.html'; //this is the live verify email //$var_SOSVerify = 'Location:https://www.bstapps.com/programer/EmailVerify/SosStartSuccess.html'; //this is the test verify email ///////////////////////////////////////////////////////// if ($var_SOSstart) $var_Location = $var_SOSVerify; else $var_Location = $var_EmailVerify; ///////////////////////////////////////////////////////// header($var_Location); ///////////////////////////////////////////////////////// //Reading ar=ID is to update the tb_SentItem //AH=database password and //Yh4=username for the database and the //brt82 is the database name appended to it the username ie DBPassSta. ///////////////////////////////////////////////////////// $From = "support@buildersit.com"; //this is the live email address $To = "support@buildersit.com"; //this is the live email address ///////////////////////////////////////////////////////// $Subject = "The verification $var_SOSstart send for from the EmailConirmation.php did not work."; ///////////////////////////////////////////////////////// $Html = "We were not able to connect to or select the database $var_Database
"; $Html .= "The file EmailConfirmation.php attempts to update the verification of E-Mail by the user when their E-Mail has changed
"; $Html .= "Your attention is urgently needed
"; ///////////////////////////////////////////////////////// $sqlstring = " UPDATE tb_SentItem SET col_VerifiedDate=\"$var_Date\" WHERE col_SentItemID=\"$var_ID\" AND col_VerifiedDate IS NULL"; //echo "
update ".$sqlstring; ///////////////////////////////////////////////////////// //$Html .= $sqlstring; //echo $Html; ///////////////////////////////////////////////////////// if ($db = mysql_connect("127.0.0.1","bstapps_EmVerify","5mS0?JMBW_EW")) { ///////////////////////////////////////////////////////// $esc_Database = mysql_real_escape_string($var_Database); $esc_ID = mysql_real_escape_string($var_ID); if ($var_Database!=$esc_Database || $var_ID!=$esc_ID) { //injection attack detected //send email that the select database did not go. SendMail($From,"",$To,"",$Subject,"",$Html,NULL); echo "
*** error 150"; } ///////////////////////////////////////////////////////// elseif (mysql_select_db($var_Database,$db)) { $CriticalResult = mysql_query($sqlstring); echo "
*** query sent"; } ///////////////////////////////////////////////////////// else { //send email that the select database did not go. SendMail($From,"",$To,"",$Subject,"",$Html,NULL); echo "
*** error 160"; } } ///////////////////////////////////////////////////////// else { //send mail failing to connect to the database. SendMail($From,"",$To,"",$Subject,"",$Html,NULL); echo "
*** error 170"; } ///////////////////////////////////////////////////////// ?>