user_login;
$table_name = $wpdb->prefix . "email_settings";
$smtp = $wpdb->get_row("select * from $table_name where email_id =1");
$admin_email = $smtp->username;
$recipent_name= $_POST['name2'];
$recipent_email= $_POST['email'];
$service = $_POST['service'];
$cellno = $_POST['cellno'];
$sttm = $_POST['radiobutton'];
$stdt = $_POST['bookdate'];
$body = "Dear Admin,
New booking arrived
Client Details
Client Name: $recipent_name
Client E-mail: $recipent_email
Booked Service: $service
Booking Status: pending
Appointment Date: $stdt
Appointment Time: $sttm
Review this appintment at dashboard.
";
//error_reporting(E_ALL);
error_reporting(E_STRICT);
date_default_timezone_set('America/Toronto');
require_once('class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded
$mail = new PHPMailer();
$body = $body; //"
Your booking will appove soon by admin.";
$body = eregi_replace("[\]",'',$body);
$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host = $smtp->host_name; // SMTP server
$mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
// 1 = errors and messages
// 2 = messages only
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->SMTPSecure = "ssl"; // sets the prefix to the servier
$mail->Host = $smtp->host_name; // sets GMAIL as the SMTP server
$mail->Port = $smtp->host_portno; // set the SMTP port for the GMAIL server
$mail->Username = $smtp->username; // GMAIL username
$mail->Password = $smtp->password; // GMAIL password
$mail->SetFrom($admin_email, $admin_name);
$mail->AddReplyTo($admin_email,$admin_name);
$mail->Subject = "New Booking Arrived By $recipent_name";
$mail->AltBody = ""; // optional, comment out and test
$mail->MsgHTML($body);
$address = $admin_email; ///recipent_email
$mail->AddAddress($address, $recipent_name);
//$mail->AddAttachment("images/phpmailer.gif"); // attachment
//$mail->AddAttachment("images/phpmailer_mini.gif"); // attachment
if(!$mail->Send()) {
//echo "Mailer Error: " . $mail->ErrorInfo;
} else {
//echo "Message sent!";
}
?>