D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
u935876328
/
domains
/
alisttowing.com.au
/
public_html
/
Filename :
sendMail.php
back
Copy
<?php $rdir = str_replace("\\", "/", __DIR__); //Root Dir require $rdir.'/PHPMailer/src/Exception.php'; require $rdir.'/PHPMailer/src/PHPMailer.php'; require $rdir.'/PHPMailer/src/SMTP.php'; use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; $mail = new PHPMailer(true); $name = $_POST['name']; $email = $_POST['email']; $phone = $_POST['phone']; $message = $_POST['message']; // Settings $mail->IsSMTP(); $mail->CharSet = 'UTF-8'; //Server settings $mail->SMTPDebug = false; //Enable verbose debug output $mail->isSMTP(); //Send using SMTP $mail->Host = 'smtp.hostinger.com'; //Set the SMTP server to send through $mail->SMTPAuth = true; //Enable SMTP authentication $mail->Username = 'admin@alisttowing.com.au'; //SMTP username $mail->Password = 'admin@Alist123'; //SMTP password $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS` $mail->setFrom('admin@alisttowing.com.au'); $mail->addAddress('info@alisttowing.com.au', 'A-LIST TOWING'); // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = $name.' try to reach A-LIST TOWING !!!'; $mail->Body = ' Hello <b>A-LIST TOWING</b>,<br> <p>Please check out below details and reach out the requester.</p> <table border="1"> <tr> <th>Name</th> <td>'.$name.'</td> </tr> <tr> <th>Email</th> <td>'.$email.'</td> </tr> <tr> <tr> <th>Phone</th> <td>'.$phone.'</td> </tr> <tr> <th>Message</th> <td style="white-space: pre-wrap;">'.$message.'</td> </tr> </table>'; $mail->send(); echo 'OK'; ?>