Edit file File name : mail.php Content :<?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'PHPMailer/src/Exception.php'; require 'PHPMailer/src/PHPMailer.php'; require 'PHPMailer/src/SMTP.php'; $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $mail = new PHPMailer(true); try { //Server settings $mail->SMTPDebug = 2; $mail->isSMTP(); $mail->Host = 'smtp.office365.com'; $mail->SMTPAuth = true; $mail->Username = 'info@xtremeupload.ie'; $mail->Password = 'password'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; //Recipients $mail->SetFrom('files@xtremeupload.ie', 'www.office365backup.ie'); $mail->addAddress('info@xtremeupload.ie'); // Add a recipient $mail->addReplyTo($email, 'Information'); //Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = 'New message from your LandingPage'; $mail->Body = ' <html> <head> <title>The message from LandingPage</title> </head> <body> <p>New submission from you landing page!</p> <table> <tr> <td>Name: </td><td>' . $name . '</td> </tr> <tr> <td>Email: </td><td>' . $email . '</td> </tr> <tr> <td>Message: </td><td>' . $message . '</td> </tr> </table> </body> </html>'; $mail->send(); echo 'Message has been sent successfully! We will connect with you soon.'; } catch (Exception $e) { // echo 'Mailer Error: ', $mail->ErrorInfo; echo 'Message could not be sent. Please try later'; } Save