Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('SMTP_DSN', 'smtp://user:pass@host:25?auth=1');
- // Do not edit below this line.
- add_action('phpmailer_init', function($phpmailer) {
- if (! defined('SMTP_DSN'))
- return;
- $smtp_data = parse_url(SMTP_DSN);
- parse_str($smtp_data['query'], $smtp_data_query);
- $phpmailer->isSMTP();
- $phpmailer->Host = $smtp_data['host'];
- $phpmailer->SMTPAuth = isset($smtp_data_query['auth'])? boolval($smtp_data_query['auth']) : false;
- $phpmailer->Port = $smtp_data['port'];
- $phpmailer->Username = $smtp_data['user'];
- $phpmailer->Password = $smtp_data['pass'];
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement