Hi!
At the forum here and on Wordpress community there were several questions where users discussed about the problem when plugin does not want to work if the mail is sent via the SMTP server.
Unfortunately, I could not find the answer. Technical support of the plugin is the same everywhere: "wpDiscuz uses WordPress wp_mail () function". This is not a big secret but it does not provide any solution to the problem.
I believe that wpDiscuz is the best plugin of its kind, but if it does not work with SMTP, its use becomes impractical. I will explain. Sending mail in WordPress by default works without additional settings, but the price is very high. The email sent via wp_mail () function does not contain additional electronic signatures (DKIM & SFP), which may indicate the reliability and legitimacy of the sender. Therefore, many email servers including Google mark such emails as spam. In this case, the most attractive feature of the wpDiscuz (notifications and subscriptions) turns out to be unrealized: the letters will either not be sent if the site uses SMTP, or it is guaranteed to go to the spam folder.
The rest of the plugins that use sending mail in Wordpress via SMTP work without any hitch. For example, Contact Form 7
If someone knows a solution to this problem please share. This will help many users from the wpDiscuz community. Perhaps there are any hooks or configuration settings that would fix the issue. I also ask technical support not to stand aside of this problem and give working instructions on how to fix this bug. Free or as part of paid technical support - anyway. The main thing is to make the plugin work properly.
Thanks.
Hi @george,
wpDiscuz doesn't have separate functions for sending email and it's totally based on WordPress email system. This is not a general issue, it works well for 99% of wpDiscuz users, however there are some rare cases that it doesn't. This is a site specific issue, maybe a plugin conflict, theme conflict or SMTP configuration issue. Or even the SMTP plugin issue, some plugins works with wpDiscuz some doesn't. In any case you should also debug it yourself by disabling all plugins, changing SMTP plugin, making changes in configuration, etc...
And here is a support topic with a link to an article which maybe helpful too: https://wordpress.org/support/topic/subscription-not-working-12/#post-11077549
Thank you. Yesterday evening I have already found this article and it really helped.
Just in case I will duplicate the problem solving algorithm here. Perhaps someone will come in handy.
- You should uninstall any SMTP plugin from your Wordpress site. All plugins I tested didn't work with wpDiscuz and mail didn't sent.
- Add following code to your wp-config.php file (above ââ Happy blogging ââ field ) and edit it according to smtp authentication of your mail:
/** SMTP Authentication */ define( 'SMTP_USER', 'user@example.com' ); // Username to use for SMTP authentication
define( 'SMTP_PASS', 'smtp password' ); // Password to use for SMTP authentication
define( 'SMTP_HOST', 'smtp.example.com' ); // The hostname of the mail server
define( 'SMTP_FROM', 'website@example.com' ); // SMTP From email address
define( 'SMTP_NAME', 'e.g Website Name' ); // SMTP From name
define( 'SMTP_PORT', '587' ); // 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', 0 ); // for debugging purposes only set to 1 or 2
If your form freezes during submission, try changing the SMTP port number. 587 worked for me.
- Add following code to functions.php of your theme or using Code Snippet plugin. (Note: if you use Child Themes, edit function.php file in your Child Theme folder to avoid losing changes after Theme update):
// SMTP Authentication
add_action( 'phpmailer_init', 'send_smtp_email' );
function send_smtp_email( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = SMTP_HOST;
$phpmailer->SMTPAuth = SMTP_AUTH;
$phpmailer->Port = SMTP_PORT;
$phpmailer->Username = SMTP_USER;
$phpmailer->Password = SMTP_PASS;
$phpmailer->SMTPSecure = SMTP_SECURE;
$phpmailer->From = SMTP_FROM;
$phpmailer->FromName = SMTP_NAME;
}
-
(optional) To keep your wp-config.php secure, add following code to your .htaccess:
<files wp-config.php>
order allow,deny
deny from all
</files>