Emails sending twice!!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Bump. We're having the same issue. While using the campaign function, the newsletter subscribers receive three identical emails. Under the message queue details, it shows only one send attempt. Anyone know the solution?
12 years ago
Try clicking the "Clear Cache" button/link on the administration page. If you had previous versions, I have a feeling the cache may have something to do with it.
12 years ago
I am having the same problem with my fresh install of the latest version of nopCommerce 2.4.

I have traced the issue to these lines of code in QueuedMessagesSendTask.cs:

                try
                {
                    _emailSender.SendEmail(queuedEmail.EmailAccount, queuedEmail.Subject, queuedEmail.Body,
                       queuedEmail.From, queuedEmail.FromName, queuedEmail.To, queuedEmail.ToName, bcc, cc);

                    queuedEmail.SentOnUtc = DateTime.UtcNow;
                }

If SendEmail throws any exception the message is not marked as sent and will be re-sent. If the email provide IS actually sending the message it will be sent each time until the maxTries is reached (set higher up in the same class).

If you check your message queue, you will see that messages that multi-sent may show a status of 'not sent' and will show the number of 'retries' taht were done.  Now trace the date/time of the message to the  Log in your nopCommerce backend down to the minute/second and see what the log is.  In my case the exception is:

Error sending e-mail. Mailbox unavailable. The server response was: Requested action not taken: mailbox unavailable or not local

Even though this exception is thrown the message IS sent, and is sent up to maxTries (default setting is 3 in v2.4)
12 years ago
So after examining the EmailSender class in EmailSender.cs, the SendEmail function is using System.Net.Mail.SmtpClient and loading the From address as well as CC's and BCC's.  In my case I had specified to send a copy of mails to an account n my server, then I moved servers and forgot to create the account on the new server.

I had set a BCC in the message template for Customer.WelcomeMessage and the BCC mailbox didn't exist on my server.  This meant that the client facing email would send OK, but the BCC would throw an exception and the customer facing mail message would never be marked as sent.  I created the email box found in the BCC on my server and the issue was fixed.  I think an enhancement here to ensure the individual confirmation of the messages are handled so that failure of CC or BCC won't cause duplicate sends to the Customer would be a good idea, however for now the problem is solved.
8 years ago
is this still true? if an address is not found and thus the email fails to send to THAT address the email would be queued AND sent again to ALL addresses? if that's the default behavoir this needs to be changed imho.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.