'') { $dbhost = '109.224.219.156'; $dbuser = 'auspat'; $dbpass = 'kimwick'; $dbname = 'maildb'; $conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting'); mysql_select_db($dbname); $ppage = $_SERVER['HTTP_REFERER']; $ppage = str_replace('http://','',$ppage); $ppage = str_replace('www.','',$ppage); $ppage = split("/",$ppage); require_once('class.phpmailer.php'); $mto=$_REQUEST['recipient']; $mfrom=$_REQUEST['email']; $mto=$mto . "@" . $ppage[0]; $subject=$_REQUEST['subject']; $mail = new PHPMailer(true); $mail->IsHTML(true); $mail->IsSMTP(); $mail->SMTPAuth = false; $mail->Host = "mail2.palmsecure.biz"; $mail->Port = 25; $mail->AddAddress($mto); $mail->AddAddress($mto); $mail->WordWrap = 150; $sql=("SELECT username, passwd FROM maildb WHERE username='$mto'"); $result=mysql_query($sql); $count=mysql_num_rows($result); if ($count>0) { if ($perror=='') { if (!preg_match("/^([a-zA-Z0-9])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/", $mto)) { $perror="The email address you are sending to is not valid"; header("location:" . $retpage . "?perror=" . $perror); } } if ($perror=='') { if (!preg_match("/^([a-zA-Z0-9])+@([a-zA-Z0-9_-])+(\.[a-zA-Z0-9_-]+)+/", $mfrom)) { $perror="The email address you are sending from is not valid"; header("location:$retpage?perror=" . $perror); } } if ($perror=='') { $info=mysql_fetch_array($result); // $mail->Username = $mto; // SMTP account username // $mail->Password = $info['passwd']; // SMTP account password $mail->SetFrom($mfrom); // $mail->AddReplyTo('name@yourdomain.com', 'First Last'); $mail->Subject = $subject; $body = ""; foreach($_REQUEST as $name => $value) { if ($name=="recipient" || $name=="email" || $name=="subject" || $name=="Submit" || $name=="redirect" || $name=="image" || $name=="formBrochure" || $name=="formCallback") { //$body .= "\n"; } else { $body .= ""; } } $body .='
$name: " . str_replace("\n","
",$value) . "




To view the message, please use an HTML compatible email viewer!'; $mail->MsgHTML($body) ; $mail->Send(); } } } ?>