I'm trying to follow the instructions here: https://gist.github.com/butlerblog/7e4dbafcbc61b15505ee8ca90510f1e7
But I'm getting confused. I'm not sure what arguments to pass where. Here is what I have:
define( 'SMTP_USER', '[email protected]' ); // The email address I use when I log in to the wp-admin page
define( 'SMTP_PASS', '123password' ); // The password I use when I log in to the wp-admin page
define( 'SMTP_HOST', 'localhost' ); // I am testing this on localhost
define( 'SMTP_FROM', '[email protected]' ); // Also the email address I use for logging in on the wp-admin page
define( 'SMTP_NAME', 'My Site Name' ); // SMTP From name
define( 'SMTP_PORT', '25' ); // SMTP port number - likely to be 25, 465 or 587
define( 'SMTP_SECURE', 'tls' ); // Encryption system to use - ssl or tls
define( 'SMTP_AUTH', true ); // Use SMTP authentication (true|false)
define( 'SMTP_DEBUG', 1 ); // for debugging purposes only set to 1 or 2
I am pretty sure I am not sending in the right stuff. When I try to use wp_mail, I get the following error in the debug log:
[0] => SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Any advice? Thank you!
SMTP_HOST
seems to suggest.wp_mail
to use a specific server for sending emails. If you definelocalhost
as yourSMTP_HOST
, then you would need a running SMTP server on your local machine. Instead, you should probably get the SMTP credentials from your hosting provider, because you will most likely use their (remote) server for sending emails.