Guest User

Untitled

a guest
Apr 6th, 2018
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. function send_mail($email,$message,$subject)
  2. {
  3. require_once('mailer/class.phpmailer.php');
  4. $mail = new PHPMailer();
  5. $mail->IsSMTP();
  6. $mail->SMTPDebug = 0;
  7. $mail->Mailer = "smtp";
  8. $mail->SMTPAuth = true;
  9. $mail->SMTPSecure = "ssl";
  10. $mail->Host = 'smtp.gmail.com';
  11. $mail->Port = 465;
  12. $mail->AddAddress($email);
  13. $mail->Username="micorreo";
  14. $mail->Password="micontraseña";
  15. $mail->SetFrom('micorreo@gmail.com','Coding Cage');
  16. $mail->AddReplyTo("micorreo@gmail.com","Coding Cage");
  17. $mail->Subject = $subject;
  18. $mail->MsgHTML($message);
  19. $mail->Send();
  20. if(!$mail->Send()) {
  21. echo "Error: " . $mail->ErrorInfo;
  22. } else {
  23. echo "Enviado!";
  24. }
  25. }
Add Comment
Please, Sign In to add comment