Guest User

Untitled

a guest
Dec 6th, 2017
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. $mail = new PHPMailer(true);
  2.  
  3. $mail->IsSMTP();
  4.  
  5. try{
  6. $mail->Host = "smtp.seudominio.com.br";
  7. $mail->SMTPAuth = true;
  8. $mail->Port = 587;
  9. $mail->Username = "webmaster@seudominio.com.br";
  10. $mail->Password = "Senha";
  11.  
  12. $mail->CharSet = 'UTF-8';
  13. //remetente
  14. $mail->SetFrom("webmaster@seudominio.com.br", "Nome Empresa");
  15. $mail->AddReplyTo("webmaster@seudominio.com.br", "Nome Empresa");
  16. $mail->Subject = "Um assunto";
  17.  
  18. //destinatários
  19. $mail->AddAddress($this->emailDestinatario, "nome destinatário");
  20. $mail->AddCC($this->emailCopia, "Cópia pra fulano");
  21.  
  22. $conteudo = "-- Dados --<br/>";
  23.  
  24.  
  25. //corpo do e-mail
  26. $mail->MsgHTML($conteudo);
  27.  
  28. $mail->Send();
  29.  
  30. return true;
  31.  
  32. }catch(phpmailerException $e){
  33. echo $e->errorMessage();
  34. return false;
  35. }
Add Comment
Please, Sign In to add comment