Advertisement
Guest User

Untitled

a guest
May 12th, 2017
607
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. // include the PHPMailer main class
  2. require("class.phpmailer.php");
  3.  
  4. $username = 'nmcclaran0730@gmail.com';
  5. $password = 'consolidate';
  6.  
  7. $recipient= array('email'=>'nmcclaran@yahoo.com', 'name'=>'Nikki');
  8.  
  9. $webmaster = array('email'=>'nmcclaran0730@gmail.com', 'name'=>'Webmaster');
  10.  
  11. $mail = new PHPMailer ();
  12.  
  13. $mail->IsSMTP();
  14.  
  15. $mail->Host= "smtp.gmail.com:587";
  16. $mail->SMTPAuth = true;
  17. $mail->Username = $username;
  18. $mail->Password= $password;
  19.  
  20. $mail->SetFrom($webmaster['email'], $webmaster['name']);
  21. $mail->AddAddress($recipient['email'], $recipient['name']);
  22. $mail->Subject = "This is the Subject";
  23. $mail->Body = "This is simply a test, does it work?";
  24.  
  25. if(!$mail->Send()) {
  26. echo "<b>Oops:</b> An error was encountered... " . $mail->ErrorInfo;
  27. } else {
  28. echo "<b>Yay:</b> Message sent successfully.";
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement