Home / Admin / Defining Other SMTP Constants
Duplicate Snippet

Embed Snippet on Your Site

Defining Other SMTP Constants

This snippet will prevent users from changing WP Mail SMTP settings in your WordPress admin area by setting up constants.

To get started, you’ll need to open your site’s wp-config.php file. Look for the line that reads:
/* That's all, stop editing! Happy publishing. */

Be sure to add any new code above this line.

Code Preview
php
<?php
/* Defining Other SMTP Constants  
 * 
 * Original doc: https://wpmailsmtp.com/docs/how-to-secure-smtp-settings-by-using-constants/
*/
define( 'WPMS_SMTP_HOST', 'example' ); // The SMTP mail host.
define( 'WPMS_SMTP_PORT', 587 ); // The SMTP server port number.
define( 'WPMS_SSL', '' ); // Possible values '', 'ssl', 'tls' - note TLS is not STARTTLS.
define( 'WPMS_SMTP_AUTH', true ); // True turns it on, false turns it off.
define( 'WPMS_SMTP_USER', 'username' ); // SMTP authentication username, only used if WPMS_SMTP_AUTH is true.
define( 'WPMS_SMTP_PASS', 'password' ); // SMTP authentication password, only used if WPMS_SMTP_AUTH is true.
define( 'WPMS_SMTP_AUTOTLS', true ); // True turns it on, false turns it off.
define( 'WPMS_MAILER', 'smtp' );

Comments

Add a Comment