This is HTML message.";
$message .= "This is headline.
";
$header = "From:enquiry@olilo.ae\r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";
$retval = mail ($to,$subject,$message,$header);
if( $retval == true ) {
echo "Message sent successfully...";
}else {
echo "Message could not be sent...";
}*/
$message = "This is HTML message.";
$message .= "This is a TestMail.
";
// $to = "linges.tsm@gmail.com";
$to = "gopi.sank@gmail.com";
$subject = "This is subject";
require 'phpmailer-master/PHPMailerAutoload.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
$mail->IsSMTP();
$mail->SMTPAuth = false;
$mail->Host = 'localhost';
$mail->Port = 25;
//Set who the message is to be sent from
$mail->setFrom("enquiry@olilo.ae", '');
//Set an alternative reply-to address
//$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress($to, '');
//Set the subject line
$mail->Subject = $subject;
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML($message);
//Replace the plain text body with one created manually
$mail->AltBody = 'This is a plain-text message body';
//Attach an image file
//$mail->addAttachment('images/phpmailer_mini.png');
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
//header('location:sorry.html');
} else {
echo "Message sent successfully...";
// header('location:thanks.html');
}
?>