SHARE
TWEET

Untitled

a guest Oct 4th, 2017 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /**
  3.  * This function will connect wp_mail to your authenticated
  4.  * SMTP server. This improves reliability of wp_mail, and
  5.  * avoids many potential problems.
  6.  */
  7. function send_smtp_email($phpmailer) {
  8.     $phpmailer->isSMTP();
  9.     $phpmailer->isHTML(true);
  10.     $phpmailer->Host = "smtp.gmail.com";
  11.     $phpmailer->SMTPAuth = true; // uncomment for gmail
  12.     $phpmailer->Port = 587;
  13.     $phpmailer->Username = "<USERNAME>";
  14.     $phpmailer->Password = "<PASSWORD>";
  15.     $phpmailer->SMTPSecure = "tls"; // uncomment for gmail
  16.     //$phpmailer->From = FROM;
  17.     //$phpmailer->FromName = FROMNAME;
  18.     //$phpmailer->SMTPDebug  = 2; // uncomment for full debug
  19. }
  20.  
  21. add_action( 'phpmailer_init', 'send_smtp_email' );
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top