Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\Exception;
- require './vendor/autoload.php';
- $phpmailer = new PHPMailer\PHPMailer;
- $phpmailer->isSMTP();
- $phpmailer->Host = 'sandbox.smtp.mailtrap.io';
- $phpmailer->SMTPAuth = true;
- $phpmailer->Port = 2525;
- $phpmailer->Username = 'your username';
- $phpmailer->Password = 'your password';
- $phpmailer->SMTPDebug = 2; // Enable verbose debug output
- $phpmailer->setFrom('test@email.com', 'Name');
- $phpmailer->addAddress('receiver1@email.net');
- $phpmailer->isHTML(true);
- $phpmailer->Subject = 'Subject';
- $phpmailer->Body = 'HTML message body in <b>bold</b>!';
- $phpmailer->AltBody = 'Body in plain text for non-HTML mail clients';
- $phpmailer->send();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement