email going to dead.letter
-
hello, for some reason, my woocommerce email is going to
dead.letter.it does not appear to be a WP issue, since i was able create a working stand-alone script:
$check = wp_mail($to, $msg, $msg, $headers);
which works fine, as does the contact-form-7 page.suggestions?
-
This topic was modified 1 day, 13 hours ago by
edwardsmark.
-
This topic was modified 1 day, 13 hours ago by
-
Hi @edwardsmark
That’s a good test you ran with
wp_mail()and Contact Form 7, and it helps narrow things down. Thedead.letterfile gets created when the server’s mail system (sendmail or postfix) rejects an outgoing message, so something about how WooCommerce builds its emails is being handled differently by your server compared to those simpler calls.A couple of questions to help us dig into this:
- When did this start? Were WooCommerce emails delivering fine before, and something changed? If so, do you recall any recent updates (WooCommerce, WordPress, plugins, or server/hosting changes)?
- Could you share your WooCommerce System Status Report? You can grab it by following the steps here: https://woocommerce.com/document/understanding-the-woocommerce-system-status-report/. Paste the report into https://pastebin.com and share the link in your reply.
- Can you flag this with your hosting provider as well? They’ll be able to check the server mail logs (
/var/log/maillogor/var/log/mail.log) for the specific rejection reason. Thedead.letterfile holds the unsent message, but the mail log will show why it was rejected. Having them investigate from the server side while we look at the WooCommerce side will help us get to the root cause faster.
In the meantime, our email troubleshooting guide covers several common causes worth reviewing: https://woocommerce.com/document/email-faq/
Looking forward to your reply.
hello – and thank you for the quick reply!
this all started happening when we transitioned to a new server a couple of weeks ago. notice that the old server was using mailx and some php SMTPmail homemade concoction.
the new server is (hopefully) only using s-nail. i am trying to force all outgoing email to use s-nail. from an earlier WP post, i was advised to add this to my
php.inifile:
sendmail_path = "tr --delete '\r' | /usr/bin/s-nail -t"/var/log/maillogshows no activity with the same timestamp as thedead.letterfor fun, i copied the
dead.letteras an html file and indeed it loads perfectly as a standalone webpage.i will play with it some more tomorrow morning. its got me wondering if it has something to do with the html vs plain text. that might be a good starting point.
pastebin: https://pastebin.com/E9jDDYqZ
-
This reply was modified 1 day, 4 hours ago by
edwardsmark.
-
This reply was modified 1 day, 4 hours ago by
edwardsmark.
-
This reply was modified 1 day, 4 hours ago by
edwardsmark.
-
This reply was modified 1 day, 4 hours ago by
edwardsmark.
-
This reply was modified 1 day, 4 hours ago by
edwardsmark.
n/a-
This reply was modified 1 day, 4 hours ago by
edwardsmark.
Hi @edwardsmark
Thank you for sharing more details about the issue
I reviewed the system status report, and I don’t see anything that would directly explain why the server is creating a
dead.letterfile. Since this started after the server migration, the mail transport configuration on the new server still looks like the most likely area to investigate.One thing we would like to confirm: are all WooCommerce emails affected, or only specific emails.
I’d also recommend continuing to work with your hosting provider or server administrator. They may be able to determine whether the custom
sendmail_pathconfiguration is affecting WooCommerce emails differently from other emails sent via WordPress.We look forward to your findings.
hi – the issue seems to impact ALL woocommerce emails. contact-form-7 is working fine. here is my standalone script that also works fine:
ini_set('display_errors', 1);ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
require_once('wp-load.php');
var_dump( wp_mail('mark@EMAIL.com', 'test subject from wp_mail()', 'test message from wp_mail()' ));using the wp-mail-SMTP appears to be a workable TEMPORARY solution.
may i ask where/how woocommerce sends email? i tried searching for all occurences of
wp_mail(and putting some diagnostic logging messages right beforewp_mail(but none of the occurences seemed to be executing. here is where i looked:
./includes/class-wc-emails.php
./includes/emails/class-wc-email.php
./includes/log-handlers/class-wc-log-handler-email.php
./packages/email-editor/src/Engine/class-send-preview-email.php
./src/Admin/API/MobileAppQRLogin.php
./src/Internal/EmailEditor/Integration.php
./src/Internal/Email/EmailLogger.phpbonus: i discovered there is a test-email-sender on this page near the bottom:
/wp-admin/admin.php?page=wc-settings&tab=email-
This reply was modified 12 hours, 22 minutes ago by
edwardsmark.
-
This reply was modified 12 hours, 22 minutes ago by
edwardsmark.
-
This reply was modified 12 hours, 12 minutes ago by
edwardsmark.
-
This reply was modified 12 hours, 11 minutes ago by
edwardsmark.
You must be logged in to reply to this topic.