is_valid){ die ('wrong captcha'); } } if(isset($_POST['name']) and $_POST['name'] != ''){$message_body .= '

Visitor: ' . $_POST['name'] . '

' . "\n" . '
' . "\n"; $subject.=$_POST['name'];} if(isset($_POST['email']) and $_POST['email'] != ''){$message_body .= '

Email Address: ' . $_POST['email'] . '

' . "\n" . '
' . "\n"; $user_email=$_POST['email'];} if(isset($_POST['state']) and $_POST['state'] != ''){$message_body .= '

State: ' . $_POST['state'] . '

' . "\n" . '
' . "\n";} if(isset($_POST['phone']) and $_POST['phone'] != ''){$message_body .= '

Phone Number: ' . $_POST['phone'] . '

' . "\n" . '
' . "\n";} if(isset($_POST['fax']) and $_POST['fax'] != ''){$message_body .= '

Fax Number: ' . $_POST['fax'] . '

' . "\n" . '
' . "\n";} if(isset($_POST['message']) and $_POST['message'] != ''){$message_body .= '

Message: ' . $_POST['message'] . '

' . "\n";} if(isset($_POST['stripHTML']) and $_POST['stripHTML']=='true'){$message_body = strip_tags($message_body);$message_type='text';} try{ include "libmail.php"; $m= new Mail("utf-8"); $m->From($user_email); $m->To($owner_email); $m->Subject($subject); $m->Body($message_body,$message_type); //$m->log_on(true); if(isset($_FILES['attachment'])){ if($_FILES['attachment']['size']>$max_file_size){ $error_text=$error_text_filesize . ' ' . $max_file_size . 'bytes'; die($error_text); }else{ if(preg_match($file_types,$_FILES['attachment']['name'])){ $m->Attach($_FILES['attachment']['tmp_name'],$_FILES['attachment']['name'],'','attachment'); }else{ $error_text=$error_text_filetype; die($error_text); } } } if(!$use_smtp){ $m->smtp_on( $host, $username, $password, $port); } if($m->Send()){ die('success'); } }catch(Exception $mail){ die($mail); } ?>