How To Create Php Message 3

[Solved] How To Create Php Message 3 | Php - Code Explorer | yomemimo.com
Question : how to create php message 3

Answered by : mugarura-bruno

<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
session_start();
if(isset($_POST['send'])){ $email = $_POST['email']; $subject = $_POST['subject']; $message = $_POST['message']; //Load composer's autoloader require 'vendor/autoload.php'; $mail = new PHPMailer(true); try { //Server settings $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = '[email protected]'; $mail->Password = 'bermzwhiteknight8'; $mail->SMTPOptions = array( 'ssl' => array( 'verify_peer' => false, 'verify_peer_name' => false, 'allow_self_signed' => true ) ); $mail->SMTPSecure = 'ssl'; $mail->Port = 465; //Send Email $mail->setFrom('[email protected]'); //Recipients $mail->addAddress($email); $mail->addReplyTo('[email protected]'); //Content $mail->isHTML(true); $mail->Subject = $subject; $mail->Body = $message; $mail->send(); $_SESSION['result'] = 'Message has been sent'; $_SESSION['status'] = 'ok'; } catch (Exception $e) { $_SESSION['result'] = 'Message could not be sent. Mailer Error: '.$mail->ErrorInfo; $_SESSION['status'] = 'error'; }	header("location: index.php");
}
?>

Source : https://www.campcodes.com/tutorials/php-tutorials/how-to-send-email-to-gmail-using-phpmailer-in-php-free-download/ | Last Update : Fri, 06 May 22

Question : how to create php message 2

Answered by : mugarura-bruno

require 'path/to/PHPMailer/src/Exception.php';
require 'path/to/PHPMailer/src/PHPMailer.php';
require 'path/to/PHPMailer/src/SMTP.php';

Source : https://www.campcodes.com/tutorials/php-tutorials/how-to-send-email-to-gmail-using-phpmailer-in-php-free-download/ | Last Update : Fri, 06 May 22

Answers related to how to create php message 3

Code Explorer Popular Question For Php