Skip to content

Instantly share code, notes, and snippets.

@erandirjunior
Created July 6, 2016 20:41
Show Gist options
  • Save erandirjunior/28ac29eb55dd2d567a2dc05c45cda6bb to your computer and use it in GitHub Desktop.
Save erandirjunior/28ac29eb55dd2d567a2dc05c45cda6bb to your computer and use it in GitHub Desktop.
Código para enviar e-mail pelo PHPMailer
require_once 'PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->isSMTP();
$mail->Host = "smtp.gmail.com";
$mail->Port = 587;
$mail->SMTPSecure = 'tls';
$mail->SMTPAuth = true;
$mail->Username = "";
$mail->Password = "";
$mail->setFrom("", "");
$mail->addAddress("");
$mail->Subject = "";
$mail->msgHTML("");
$mail->AltBody = "";
if ($mail->send()) {
// Se enviar
} else {
// Se não enviar
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment