Advertisement
Guest User

Untitled

a guest
May 9th, 2016
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. define('SMTP_HOST', 'smtp.examplemailer.com');
  2. define('SMTP_PORT', 587);
  3. define('SMTP_USER', 'myuser');
  4. define('SMTP_PASSWORD', 'mypassword');
  5. define('SMTP_CRYPT', 'tls'); // encryption system (ssl or tls)
  6. define('SMTP_FROM_EMAIL', 'hello@example.com');
  7. define('SMTP_FROM_NAME', 'My Company');
  8.  
  9. // Send WordPress emails via SMTP
  10. function forge_smtp_email($phpmailer){
  11.  
  12. $phpmailer->isSMTP();
  13. $phpmailer->Host = SMTP_HOST;
  14. $phpmailer->SMTPAuth = true;
  15. $phpmailer->Port = SMTP_PORT;
  16. $phpmailer->Username = SMTP_USER;
  17. $phpmailer->Password = SMTP_PASSWORD;
  18. $phpmailer->SMTPSecure = SMTP_CRYPT;
  19. $phpmailer->From = SMTP_FROM_EMAIL;
  20. $phpmailer->FromName = SMTP_FROM_NAME;
  21.  
  22. }
  23. add_action('phpmailer_init', 'forge_smtp_email');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement