// 6/6/2005 - Corrected email processing
// mailadmin is the POP
// ContacUs is only a forward
// 4/10/2005 - Added hours of operation
// -----------------------------------------------
function subEmailMsg($varMsg)
{
extract($GLOBALS);
$strName=${"txtName"};
$clsMail=new clsSendMail();;
$clsMail->SMTPuserID="MailAdmin@DivingWorldUSA.com";
$clsMail->SMTPpswd="s2jar3";
$clsMail->FromEmail="MailAdmin@DivingWorldUSA.com";
$clsMail->ToEmail="ContactUs@DivingWorldUSA.com";
$clsMail->bcc="DivingWorldContactUS@star-tech.org";
$clsMail->Subject="Contact Request - from ".$strName;
$clsMail->Priority=1;
$cr=chr(13).chr(10);
$cr="
";
$strBody="This message was generated by an automated routine.".$cr.
"PLEASE DO NOT REPLY TO THIS MESSAGE!".$cr.$cr.
"Date: ".$subformatdate[strftime("%m/%d/%Y %H:%M:%S %p")()]["m/d/yyyy"]." ".$subformattime[strftime("%m/%d/%Y %H:%M:%S %p")()]["hh:mm ampm"].$cr.
"Website Contact Request Form from ".$strName."".$cr.$cr.
"Name: ".${"txtName"}.$cr.
"Phone: ".${"txtPhone"}.$cr.
"Email Address: ".${"txtEmail"}.$cr.$cr;
for ($intX=1; $intX<=6; $intX=$intX+1)
{
if (${"chk".$intX}!="")
{
$strBody=$strBody.${"chk".$intX}.$cr;
}
}
$strBody=$strBody.$cr.$subCommentWithLineBreaks[${"txtComment"}];
$clsMail->Body=$strBody;
$clsMail->HTML=true;
$intRetval=$clsMail->SendMail();
if (!$intRetval)
{
$varMsg="Your contact message was not sent. Please send an email to webmaster@DivingWorldUSA.com to report this problem, or call our shop at (404)634-4354";
}
$clsMail=null;
$function_ret=$intRetval;
return $function_ret;
}
// -----------------------------------------------
// VALIDATION
$intErrors=false;
$strMargin=" ";
if ($_SERVER["Content_Length"]>0)
{
// NAME CANNOT BE BLANK
$strName=${"txtName"};
if ($strName=="")
{
$strErrorMsg=$strErrorMsg.$strMargin."Name has not been entered
";
$intErrors=true;
}
// WORK OR PHONE NUMBER MUST BE SUPPLIED
if (${"txtPhone"}=="")
{
$strErrorMsg=$strErrorMsg.$strMargin."Phone number has has not been specified.
";
$intErrors=true;
}
// VALIDATE EMAIL
$strEmail=${"txtEmail"};
if ($strEmail!="")
{
$intRetval=$subValidateEmail[$strEmail][$strMargin][$strEmailMsg];
if (!$intRetval)
{
$strErrorMsg=$strErrorMsg.$strEmailMsg;
$intErrors=true;
}
}
// SEND EMAIL
if (!$intErrors)
{
$intRetval=subEmailMsg($strErrorMsg);
if (!$intRetval)
{
$intErrors=true;
}
}
}
?>
![]() ![]() ![]() ![]() ![]() ![]() |
||||||||||||
|
if ($_SERVER["Content_Length"]>0)
{
if ($intErrors)
{
print "Errors: ".$strErrorMsg.""; } else { print "
|
||||||||||||