Advertisement
Guest User

codigo conf phpmailer

a guest
Feb 2nd, 2017
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | None | 0 0
  1. $mail = new PHPMailer();
  2.  
  3.         $mail->CharSet = 'UTF-8';
  4.         $mail->isSMTP();
  5.         $mail->Host = '**aqui vai o servidor de email fornecido pelo host**';
  6.         $mail->SMTPAuth = true;
  7.         $mail->Username = '**email de envio**';
  8.         $mail->Password = '**senha**';
  9.         $mail->SMTPSecure = 'tls';
  10.         $mail->Port = 587;
  11.  
  12.         $mail->setFrom('contato@e-ducar.info', "Contato Plataforma E-ducar");
  13.  
  14.         $mail->addAddress("$email");
  15.  
  16.         $mail->addReplyTo('backup@e-ducar.info');
  17.  
  18.         $mail->isHTML(true);
  19.  
  20.         $mail->Subject = 'Plataforma E-ducar - Redefinição de Senha';
  21.  
  22.         $mail->Body    = "<h1>Redefinição de Senha</h1><br>"
  23.                             . "<h3>Clique aqui para ir para a página de recadastro de senha</h3>"
  24.                             . "<br><br>Atenciosamente,"
  25.                             . "<br>Equipe E-ducar";
  26.  
  27.         $mail->AltBody = "Aqui vai o texto de teste";
  28.  
  29.         if(!$mail->send()) {
  30.             echo "<script>alert('Message could not be sent')</script>";
  31.             echo "<script>alert('Mailer Error: " . $mail->ErrorInfo . "')</script>";
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement