" => $_REQUEST[company], "<%NAME%>" => $_REQUEST[name], "<%ADDRESS%>" => $_REQUEST[address], "<%MESSAGE%>" => $_REQUEST[message], "<%URL%>" => $_REQUEST[url], "<%EMAIL%>" => $_REQUEST[email], "<%TITLE%>" => $_REQUEST[title], "<%COUNTRY%>" => $_REQUEST[country], ); //* 2015-03-27 Test mail function $from = 'no-reply@wavestravelbkk.com'; emailer_2("info@wavestravelbkk.com",$_REQUEST['subject'], $from, "template/mail_contact.html", $replace_list); /** IMPORTANT :: modify emailer_2 to send 2 email contact@wavestravelbkk.com & info @wavestravelbkk.com */ } ?> $value) { $message = str_replace($key, $value, $message); } //addDebug('function emailer($to, $subject, $from, $filename, $replace_list): replace list: ' . $message); //* Mail send $headers = "MIME-Version: 1.0\n"; //$headers .= "Content-type: text/html; charset=windows-874\n"; $headers .= "Content-type: text/html; charset=UTF-8\n"; if(strlen($from) < 5) { $headers .= "From: Robot\n"; } else { $headers .= "From: ".$from."\n"; } //mail($to, $subject, $message, $headers); $mail = new PHPMailer; $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'outmail.csloxinfo.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'wavestravelbkk@outmail.csloxinfo.com'; // SMTP username $mail->Password = 'e9wVL2gk'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; $mail->AddReplyTo($replace_list['<%EMAIL%>'], $replace_list['<%NAME%>']); $mail->From = 'no-reply@wavestravelbkk.com'; $mail->FromName = 'No Reply'; $mail->addAddress($to); $mail->addAddress("contact@wavestravelbkk.com"); $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = $message; $mail->send(); } ?>