Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Tested PhpMailer v6.0.7
- */
- use PHPMailer\PHPMailer\PHPMailer;
- require 'vendor/autoload.php';
- $mail = new PHPMailer();
- $mail->SMTPOptions = array(
- 'ssl' => array(
- 'verify_peer' => false,
- 'verify_peer_name' => false,
- 'allow_self_signed' => true
- )
- );
- $mail->IsSMTP();
- $mail->Host = "smtp.gmail.com";
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = "@gmail.com";
- $mail->Password = "";
- $mail->SetFrom("@gmail.com");
- $mail->addAddress("@");
- $mail->IsHTML(false);
- $mail->Subject = "Subject";
- $mail->Body = "Message";
- if(!$mail->Send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- } else {
- echo "Message has been sent";
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement