Advertisement
Guest User

Untitled

a guest
May 29th, 2017
628
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. $mail = new PHPMailer(); // create a new object
  2. $mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
  3. $mail->SMTPAuth = true; // authentication enabled
  4. $mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
  5. $mail->Host = "XXX.XXX.XXX.XXX";
  6. $mail->Port = XXX; // or 587
  7. $mail->IsHTML(true);
  8. $mail->Username = "XXX@xyz.com";
  9. $subject = 'verfication email';
  10. $mail->Password = "XXXXXX";
  11. $mail->SetFrom('XXX@xyz.com');
  12. $mail->Subject = $subject;
  13. $user_login = $user->user_login;
  14. $user_id = $user->ID;
  15. $email = $user->user_email;
  16. $mail->addAddress($email);
  17.  
  18. $mail->Body = 'Welome'.'<br>'.'Kindly Click On Below link to activate your account';
  19.  
  20. if(!$mail->Send())
  21. {
  22. echo "Mailer Error: " . $mail->ErrorInfo;
  23. }
  24. else
  25. {
  26. echo 'Thank you for registering ' . $user->user_login;
  27. echo '<br/>Kindly verify your email.'.$email;
  28.  
  29. } // great Thanks to **Harneet Kaur**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement