My Page
require_once 'vendor/autoload.php'; // Use PHPMailer use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; // Create a new PHPMailer instance $mail = new PHPMailer(true); // Set up SMTP $mail->SMTPDebug = 2; $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = 'your-email@gmail.com'; $mail->Password = 'your-password'; $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; $mail->Port = 465; // Set up message $mail->setFrom('your-email@gmail.com', 'Your Name'); $mail->addAddress('recipient-email@gmail.com', 'Recipient Name'); $mail->Subject = 'Test Email'; $mail->Body = 'Hello, World!'; // Send message if (!$mail->send()) { echo 'Mailer Error: ' . $mail->ErrorInfo; } else { echo 'Message sent successfully!'; }In the second example, Composer is used to install and utilize the PHPMailer package library for sending email messages.