D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
realadss
/
.trash
/
Filename :
mailer.php
back
Copy
<?php require 'phpmailer/PHPMailer/class.phpmailer.php'; require 'phpmailer/PHPMailer/class.smtp.php'; require "phpmailer/PHPMailer/PHPMailerAutoload.php"; $name = $_POST['name'] ?? "N/A"; $phone = $_POST['phone'] ?? "N/A"; $email = $_POST['email'] ?? "N/A"; $event = $_POST['date'] ?? "N/A"; $message = $_POST['message'] ?? "N/A"; $message2 = ' <html> <head> <title>Enquiry Mail</title> <body> <div> <h3>Enquiry Mail</h3> <div class="row"> <div class="col-6">Name - '.$name.'</div> <div class="col-6">Contact info - '.$phone.'</div> <div class="col-6">Email - '.$email.'</div> <div class="col-6">Event Date - '.$event.'</div> <div class="col-6">Message - '.$message.'</div> </div> </div> </body> </html> '; try { $mail = new PHPMailer(); $mail->IsSMTP(); $mail->SMTPDebug = 0; $mail->SMTPAuth = true; $mail->Host = 'mail.gurgaonpartyplanner.in'; $mail->Username = 'info@gurgaonpartyplanner.in'; $mail->Password = 'Welcome@2121@'; // $mail->SMTPAutoTLS = true; $mail->SMTPSecure = 'ssl'; $mail->Port = 465; $mail->setFrom="gurgaonpartyplanner@gmail.com"; $mail->FromName="Gurgaon Party Planner"; $mail->addAddress("gurgaonpartyplanner@gmail.com"); //$mail->addAddress("mmustakimbhai@gmail.com"); $mail->IsHTML(true); $mail-> Subject = "Enquiry From Website"; $mail-> Body = $message2; if($mail->send()){ }else{ //echo ("Mail not Send!"); } } catch (Exception $e) { // echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } echo header("location:thanku"); ?>