/
home
/
tathagathearthos
/
public_html
/
New Directory
Upload File
HOME
<?php require "./PHPMailer_5.2.0/class.phpmailer.php"; $name = $_POST['name']; $phone = $_POST['phone']; $date = $_POST['date']; $time = $_POST['time']; // Basic validation if ($name === '' || $phone === '' || $date === '' || $time === '') { echo 'Invalid form data'; exit; } $adminoutput = '<!DOCTYPE html> <html> <head> <title>Tathagat-Appointment</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <style> .block{ background-color: #0E0F85; display: inline-block; color: #fff; border-radius: 20px; padding: 20px; font-size: 18px; } </style> </head> <body> <div class="block"> <p>Name : <b>' . $name . '</b></p> <p>Phone : <b>' . $phone . '</b></p> <p>Date : <b>' . $date . '</b></p> <p>Time : <b>' . $time . '</b></p> </div> </body> </html>'; $toaddress = "Tathagatmahantesh@gmail.com"; $mail = new PHPMailer(); $mail->isSendmail(); $mail->Subject = 'Tathagat | New Appointment Request - ' . $name . ' (Website)'; $mail->setFrom('no-reply@tathagathearthospital.com', 'Tathagat'); $mail->addAddress($toaddress); // $mail->AddCC(''); $mail->IsHTML(true); $mail->Body = preg_replace('/\[\]/', '', $adminoutput); if ($mail->send()) { echo 'Your Appointment request is submitted successfully.'; exit(0); } else { echo 'Sorry.. Please try again later...'; //echo $mail->ErrorInfo; exit(0); }