Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <?php
  2. require_once('class.phpmailer.php');
  3.  
  4. $mail = new PHPMailer();
  5. $mail->IsSMTP();
  6. $mail->CharSet="UTF-8";
  7. $mail->SMTPSecure = 'tls';
  8. $mail->Host = 'smtp.gmail.com';
  9. $mail->Port = 587;
  10. $mail->Username = 'mailsemillas@gmail.com';
  11. $mail->Password = 'agente2016';
  12. $mail->SMTPAuth = true;
  13.  
  14. $mail->From = 'mailsemillas@gmail.com';
  15. $mail->FromName = 'Mohammad Masoudian';
  16. $mail->AddAddress('oguisk@hotmail.com');
  17. $mail->AddReplyTo('oguisk@hotmail.com', 'Information');
  18.  
  19. $mail->IsHTML(true);
  20. $mail->Subject = "PHPMailer Test Subject via Sendmail, basic";
  21. $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
  22. $mail->Body = "Hello";
  23.  
  24. if(!$mail->Send())
  25. {
  26. echo "Mailer Error: " . $mail->ErrorInfo;
  27. }
  28. else
  29. {
  30. echo "Message sent!";
  31. }
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement