0,'errors'=>$err )); exit; } if(!empty($_POST)){ if($_POST['subject'] != '') { $subject = $_POST['subject']; if($subject == 'Technical Support' || $subject == 'Billing' || $subject == 'Sales') $mail_to = 'support@websites.att-mail.com'; if($subject == 'Website Design') $mail_to = 'designsupport@webdesign.att-mail.com'; } else { $subject = 'Support Message'; $mail_to = 'support@websites.att-mail.com'; } $message_question = $_POST['message_question']; $domain_name = $_POST['domain_name']; $name_account = $_POST['name_account']; $contact_name = $_POST['contact_name']; $email = $_POST['email']; $body = "Message/Question: {$message_question}
Domain Name: {$domain_name}
Name on Account: {$name_account}
Contact Name: {$contact_name}
Phone Number: {$phone}
Email Address: {$email}
"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: <{$mail_from}>"; $res = mail($mail_to, $subject, $body, $headers); if($res) { echo json_encode(array('success' => 1,'errors'=>$err )); exit; } else { echo json_encode(array('success' => 0,'errors'=>array('mail_not_send'=>1,))); exit; } } ?>