Advertisement
Guest User

Untitled

a guest
Aug 31st, 2016
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2.  
  3. define('SMTP_DSN', 'smtp://user:pass@host:25?auth=1');
  4.  
  5. // Do not edit below this line.
  6. add_action('phpmailer_init', function($phpmailer) {
  7.  
  8. if (! defined('SMTP_DSN'))
  9. return;
  10.  
  11. $smtp_data = parse_url(SMTP_DSN);
  12. parse_str($smtp_data['query'], $smtp_data_query);
  13.  
  14. $phpmailer->isSMTP();
  15. $phpmailer->Host = $smtp_data['host'];
  16. $phpmailer->SMTPAuth = isset($smtp_data_query['auth'])? boolval($smtp_data_query['auth']) : false;
  17. $phpmailer->Port = $smtp_data['port'];
  18. $phpmailer->Username = $smtp_data['user'];
  19. $phpmailer->Password = $smtp_data['pass'];
  20. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement