Error with WP Mail SMTP
-
Hey StCr team,
I just installed, set up and made a few tests with your plugin.
(I use WP Mail SMTP to send emails.)
Unfortunately, I none of the emails were sent.
I found this in the error log from WP Mail SMTP:
Email Source: Subscribe to Comments Reloaded Mailer: Autre SMTP SMTP Error: data not accepted. SMTP server error: DATA END command failed Detail: Error: reply_to_field_is_not_present SMTP code: 554I’ve checked in your plugins and I correctly filled the “reply to” email in the “notifications” tab.
-
Do you have logging enabled in WP Mail SMTP, does it show more info about the failed mail attempt, specifically does it show any value for the “Reply-To” value.
And are you able to make some code changes to the plugin files?
In
wp-content/plugins/subscribe-to-comments-reloaded/utils/stcr_utils.phpon line496is where the value for the “Reply-To” is fetched.'reply_to' => $reply_to,Can you modify that to:
'reply_to' => '[email protected]',Change it to your email address of course.
Then do a test again, if the issue is fixed then the problem is in getting the value from the settings, if the issue is still not resolved then it’s some conflict with the WP Mail SMTP plugin.
Let me know what happens so we know how to proceed.
Hey team,
I’ve tried your fit but it didn’t work.
I got this error:
Mailer: Autre SMTP SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Error: reply_to_field_is_not_present SMTP code: 554Here’s the full debugging info:
Mailer: Autre SMTP SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Error: reply_to_field_is_not_present SMTP code: 554 Debug Output: Connection: opening to mx.get-enterprise.pl:25, timeout=300, options=array() Connection: opened SERVER -> CLIENT: 220 GetResponse.com ESMTP Service ready CLIENT -> SERVER: EHLO formations.ispeakspokespoken.com SERVER -> CLIENT: 250-GetResponse.com Service ready 250 STARTTLS CLIENT -> SERVER: STARTTLS SERVER -> CLIENT: 220 Ready to start TLS CLIENT -> SERVER: EHLO formations.ispeakspokespoken.com SERVER -> CLIENT: 250-GetResponse.com Service ready 250-STARTTLS 250 AUTH LOGIN PLAIN CLIENT -> SERVER: AUTH LOGIN SERVER -> CLIENT: 334 VXNlcm5hbWU6 CLIENT -> SERVER: [credentials hidden] SERVER -> CLIENT: 334 UGFzc3dvcmQ6 CLIENT -> SERVER: [credentials hidden] SERVER -> CLIENT: 235 Authentification successful. CLIENT -> SERVER: MAIL FROM: SERVER -> CLIENT: 250 sender [email protected] OK CLIENT -> SERVER: RCPT TO: SERVER -> CLIENT: 250 recipient [email protected] OK CLIENT -> SERVER: DATA SERVER -> CLIENT: 354 Start mail input; end with . CLIENT -> SERVER: Date: Wed, 27 Jul 2022 13:32:29 +0000 CLIENT -> SERVER: To: [email protected] CLIENT -> SERVER: From: Adrien CLIENT -> SERVER: Reply-To: [email protected] CLIENT -> SERVER: Subject: =?UTF-8?Q?Il_y_a_un_nouveau_commentaire_=C3=A0_Comment_suivre_cette_formation_=3F?= CLIENT -> SERVER: Message-ID: CLIENT -> SERVER: X-Mailer: WPMailSMTP/Mailer/smtp 3.5.1 CLIENT -> SERVER: X-Post-Id: 7995 CLIENT -> SERVER: X-Comment-Id: 55969 CLIENT -> SERVER: MIME-Version: 1.0 CLIENT -> SERVER: Content-Type: text/html; charset=UTF-8 CLIENT -> SERVER: Content-Transfer-Encoding: 8bit CLIENT -> SERVER: CLIENT -> SERVER: Il y a un nouveau commentaire à Comment suivre cette formation ?There is a new comment on Comment suivre cette formation ?. CLIENT -> SERVER: CLIENT -> SERVER: Comment link: https://formations.ispeakspokespoken.com/lecons/comment-suivre-cette-formation-rta/comment-page-1/#comment-55969 CLIENT -> SERVER: Author: Dany CLIENT -> SERVER: Comment: CLIENT -> SERVER: test 3 CLIENT -> SERVER: Permalink: https://formations.ispeakspokespoken.com/lecons/comment-suivre-cette-formation-rta/ CLIENT -> SERVER: Manage your subscriptions | One click unsubscribe CLIENT -> SERVER: CLIENT -> SERVER: CLIENT -> SERVER: . SERVER -> CLIENT: 554 Error: reply_to_field_is_not_present SMTP ERROR: DATA END command failed: 554 Error: reply_to_field_is_not_present SMTP Error: data not accepted.The SMTP plugin works really well with other plugins that we have such as Wishlist Member, Learndash, …
Hope this helps!
Couple things.
1) Is the same “reply to” email address used when the emails are sent out from LearnDash (and the other plugins)?
2)
On line 521 (same file as before) is:
$sent_result = ( wp_mail( $_emailSettings['toEmail'], $_emailSettings['subject'], $_emailSettings['message'], $headers ) )Change that to:
$sent_result = ( wp_mail( $_emailSettings['toEmail'], $_emailSettings['subject'], 'Testing STCR' ) )So that’s the basic email request, address and subject are from StCR, the content is changed to just say “Testing STCR” and there’s no additional headers (where reply-to and other things are located).
Let me know what happens.
Then try this:
$sent_result = ( wp_mail( $_emailSettings['toEmail'], $_emailSettings['subject'], $_emailSettings['message'] ) )That is with the addition of the original message. Let me know what happens.
Hey @wpkube,
Thanks for the detailed and quick answer.
1) Yes.
2.1) I tested your first snippet and it worked. I received an email containing:
Testing STCR2.2) I tested the second snippet and it worked too. I received the email containing the comment’s details. However, I received in plain HTML, it looked like that:
You’re welcome. Sorry for the wait, I’ve been sick for a few days.
2.2) Yeah, since the headers part is missing it’s not being sent out as an HTML email, so it’s in plain text. But we’re getting closer to the solution.
Let’s revert back that line to the original:
$sent_result = ( wp_mail( $_emailSettings['toEmail'], $_emailSettings['subject'], $_emailSettings['message'], $headers ) )And let’s adjust the code on line 505:
$headers .= "Reply-To: {$_emailSettings['reply_to']}\n";Make it into:
//$headers .= "Reply-To: {$_emailSettings['reply_to']}\n";That “comments out” the code and it won’t apply.
Then do a test and let me know what happens.
The topic ‘Error with WP Mail SMTP’ is closed to new replies.