Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail = new PHPMailer(true);
- try
- {
- //Tell PHPMailer to use SMTP
- $mail->isSMTP();
- $mail->SMTPDebug = 2;
- $mail->Debugoutput = 'html';
- $mail->Host = "smtp.gmail.com";
- $mail->Port = 587;
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = "tls";
- $mail->Username = "username@gmail.com";
- $mail->Password = "pass";
- $mail->setFrom('username@gmail.com', 'First Last');
- $mail->addAddress("$mailto", 'John Doe');
- $mail->Subject = 'PHPMailer SMTP test';
- $mail->msgHTML("asdf");
- $mail->AltBody = 'This is a plain-text message body';
- $mail->AddStringAttachment($qr_base64, "Filename.png");
- $mail->send();
- } catch (phpmailerException $e) {
- echo $e->errorMessage();
- } catch (Exception $e) {
- echo $e->getMessage();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement