// Content $mail->isHTML(true); $mail->Subject = 'Test Email'; $mail->Body = 'This is a <b>test email</b>'; $mail->AltBody = 'This is a plain text version';
// Recipients $mail->setFrom('from@example.com', 'Your Name'); $mail->addAddress('recipient@example.com', 'Recipient Name'); $mail->addReplyTo('reply@example.com', 'Reply Name'); phpmailer download
$mail = new PHPMailer(true);
try { // Server settings $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; $mail->SMTPAuth = true; $mail->Username = 'your@gmail.com'; $mail->Password = 'your-app-password'; $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587; // Content $mail->