Created
April 6, 2020 19:25
-
-
Save brunocmoraes/e826a8c2b1221cff58c1702c87a53b03 to your computer and use it in GitHub Desktop.
Envio de e-mail na caixa de entrada com Php Mailer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'vendor/autoload.php'; | |
use PHPMailer\PHPMailer\PHPMailer; | |
use PHPMailer\PHPMailer\Exception; | |
$mail = new PHPMailer(true); | |
$mail->CharSet = 'UTF-8'; | |
$mail->setLanguage('pt_br'); | |
$mail->SMTPDebug = 0; | |
$mail->isSMTP(); | |
$mail->Host = 'mail.caqo.com.br'; | |
$mail->SMTPAuth = true; | |
$mail->Username = '[email protected]'; | |
$mail->Password = 'xxx'; | |
$mail->SMTPSecure = 'tls'; | |
$mail->Port = 587; | |
$mail->Subject = 'Assunto da mensagem'; | |
$mail->isHTML(true); | |
$mail->setFrom($mail->Username, 'CAQO Marketing'); | |
$mail->addAddress('[email protected]', 'Nome que recebe'); | |
$message = 'html da mensagem'; | |
$mail->Body = $message; | |
$mail->AltBody = ''; // versão txt do e-mail (sem html) | |
$mail->send(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment