Advertisement
Guest User

Untitled

a guest
Jun 2nd, 2017
546
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 KB | None | 0 0
  1. <?php
  2. /**
  3. * @link
  4. * @since 1.0.0
  5. * @package TODO
  6. *
  7. * @wordpress-plugin
  8. * Plugin Name: Use MailHog
  9. * Description: Configure WordPress on Valet to use MailHog
  10. * Version: 1.0.0
  11. * Tags: local, email
  12. */
  13.  
  14. add_action( 'phpmailer_init', 'bish_configMH', 10, 1 );
  15. function bish_configMH( $phpmailer ) {
  16. // Define that we are sending with SMTP
  17. $phpmailer->isSMTP();
  18.  
  19. // The hostname of the mailserver
  20. $phpmailer->Host = 'localhost';
  21.  
  22. // Use SMTP authentication (true|false)
  23. $phpmailer->SMTPAuth = false;
  24.  
  25. // SMTP port number
  26. // Mailhog normally run on port 1025
  27. $phpmailer->Port = WP_DEBUG ? '1025' : '25';
  28.  
  29. // Username to use for SMTP authentication
  30. // $phpmailer->Username = 'yourusername';
  31.  
  32. // Password to use for SMTP authentication
  33. // $phpmailer->Password = 'yourpassword';
  34.  
  35. // The encryption system to use - ssl (deprecated) or tls
  36. // $phpmailer->SMTPSecure = 'tls';
  37.  
  38. $phpmailer->From = 'site_adm@wp.local';
  39. $phpmailer->FromName = 'WP DEV';
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement