<?php
require("class.phpmailer.php");
//require '/home/silentvalley/public_html/PHPMailer/src/Exception.php';
//require '/home/silentvalley/public_html/class.phpmailer.php';
//require '/home/silentvalley/public_html/class.smtp.php';

require("class.smtp.php");

$mail = new PHPMailer;

$mail->IsSMTP();                                      // Set mailer to use SMTP
$mail->Host = 'smtppro.zoho.in';                 // Specify main and backup server

//$mail->Host = "Give IP Address";                 // If the above does not work.
$mail->Port = 465;                                    // Set the SMTP port
$mail->SMTPAuth = true;                               // Enable SMTP authentication
$mail->Username = "contact@ontimesolution.in";                // SMTP username

$mail->Password = "Suji@2025";                  // SMTP password


 $phone = $_REQUEST['phone'] ;
 $message = $_REQUEST['message'] ;
 $name = $_REQUEST['name'];
 $email = $_REQUEST['email']; 


$mail->SMTPSecure = "ssl";                            // Enable encryption, 'ssl' also accepted
 //$mail->setFrom('hostingraja@silentvalleyresorts.com', 'Silent Valley Mailer'//$mail->From = 'hostingraja@silentvalleyresorts.com';
  $mail->From = 'contact@ontimesolution.in';
$mail->FromName = 'Yenepoya website mailer';
//$mail->AddAddress('otsolutions.mlr@gmail.com');
$mail->AddAddress('veetadsouza@gmail.com');  // Add a recipient
 $mail->addReplyTo( $email, $name);
$mail->IsHTML(true);   // Set email format to HTML

$mail->Subject = 'Email Enquiry';
$mail->Body    = 'Name  : '.$name. '<br>Email : '.$email.'<br> Phone Number : '.$phone.'<br> Message : '.$message;
 
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

if(!$mail->Send()) {
	print_r($mail);
   echo 'Message could not be sent.';
   echo 'Mailer Error: ' . $mail->ErrorInfo;
   exit;
}

 header("Location:thankyou.php");
exit(0);?>  







