- Open the wp-config.php file in your WordPress installation.
- Add the following lines of code to specify the SMTP settings for PHPMailer:
define( 'PHPMAILER_HOST', 'mail.example.com' );
define( 'PHPMAILER_PORT', 587 );
define( 'PHPMAILER_USER', 'username' );
define( 'PHPMAILER_PASS', 'password' );
define( 'PHPMAILER_SECURE', 'tls' );
- Replace 'mail.example.com' with the SMTP host of your email provider.
- Replace '587' with the appropriate port number for your email provider.
- Replace 'username' with your email account username.
- Replace 'password' with your email account password.
- Set 'tls' or 'ssl' based on the security protocol supported by your email provider.
- Save the wp-config.php file and test your email functionality.