Using SMTP for emailing in WordPress Multisite
To enable SMTP emailing (use SMTP instead of mail()) in a WordPress Multisite, you can do this:
1. Install this plugin in network admin dashboard: WP MAIL SMTP (https://wordpress.org/plugins/wp-mail-smtp/)
2. Add these settings to wp-config.php:
define('WPMS_ON', true);
define('WPMS_MAIL_FROM', 'myemail@mydomain.com');
define('WPMS_MAIL_FROM_NAME', 'My WordPress Multisite');
define('WPMS_MAILER', 'smtp'); // Possible values 'smtp', 'mail', or 'sendmail'
define('WPMS_SET_RETURN_PATH', 'false'); // Sets $phpmailer->Sender if true
define('WPMS_SMTP_HOST', 'smtp.gmail.com'); // The SMTP mail host
define('WPMS_SMTP_PORT', 587); // The SMTP server port number
define('WPMS_SSL', 'tls'); // Possible values '', 'ssl', 'tls' - note TLS is not STARTTLS
define('WPMS_SMTP_AUTH', true); // True turns on SMTP authentication, false turns it off
define('WPMS_SMTP_USER', 'myemail@mydomain.com'); // SMTP authentication username, only used if WPMS_SMTP_AUTH is true
define('WPMS_SMTP_PASS', 'ThePasswordGenius'); // SMTP authentication password, only used if WPMS_SMTP_AUTH is true
3. In network admin dashboard, network activate the plugin (with the wp-config settings, the admin panel of wp-mail-smtp will be disabled)
Cool!
1. Install this plugin in network admin dashboard: WP MAIL SMTP (https://wordpress.org/plugins/wp-mail-smtp/)
2. Add these settings to wp-config.php:
define('WPMS_ON', true);
define('WPMS_MAIL_FROM', 'myemail@mydomain.com');
define('WPMS_MAIL_FROM_NAME', 'My WordPress Multisite');
define('WPMS_MAILER', 'smtp'); // Possible values 'smtp', 'mail', or 'sendmail'
define('WPMS_SET_RETURN_PATH', 'false'); // Sets $phpmailer->Sender if true
define('WPMS_SMTP_HOST', 'smtp.gmail.com'); // The SMTP mail host
define('WPMS_SMTP_PORT', 587); // The SMTP server port number
define('WPMS_SSL', 'tls'); // Possible values '', 'ssl', 'tls' - note TLS is not STARTTLS
define('WPMS_SMTP_AUTH', true); // True turns on SMTP authentication, false turns it off
define('WPMS_SMTP_USER', 'myemail@mydomain.com'); // SMTP authentication username, only used if WPMS_SMTP_AUTH is true
define('WPMS_SMTP_PASS', 'ThePasswordGenius'); // SMTP authentication password, only used if WPMS_SMTP_AUTH is true
3. In network admin dashboard, network activate the plugin (with the wp-config settings, the admin panel of wp-mail-smtp will be disabled)
Cool!