smtp_host = "70.102.129.133"; //"bobo.semilogic.com"; // $smtpmail->smtp_port = 465; function isValidEmail($email) { if(strlen($email) < 6) return false; $at = strstr($email, "@"); $dot = strstr($email, "."); if(!$at || !$dot) return false; return true; } if($_POST["action"] == "sendmsg") { $email = $_POST["email"]; if(isValidEmail($email)) { $hdrs = "From: $email\r\n"; $hdrs .= "Reply-To: $email\r\n"; $subj = "Website Contact"; } else { $hdrs = "From: $mailfrom\r\n"; $subj = "Website Contact from $email"; } $msg = "\r\n".$_POST["msg"]."\r\n"; // mail($mailto, $subj, $msg, $hdrs); if(!$smtpmail->send($mailto, $mailfrom, $subj, $msg, $hdrs)) { die("Error while attempting to send an email titled $subj:" . $smtpmail->errorMsg()); } ?>