Trouble Shooting Email Queue

Eric Garrison asked on February 2, 2015 18:43

I seem to be having issue on v7 with the email queue pretty consistently. We go into the queue and hit resend, and all go out just fine. We operate the email server that it relays off of and no issue there. It is whitelisted to allow the Kentico server to relay and they are on the same subnet.

Most of the emails in queue are BizForm submissions and due to captcha, we have very little spam. Many other Order confirmations are in there also. I have followed the instructions on the link below and enabled logging. The strange part is that it looks like it is not trying. I am not getting any "Rejection". It even looks like the log stops logging until I hit the resent. After resend, it is fine for a few days, then we will get it stuck again.

INSTANT Message seem to send fine.If I do the test email at the same time the queue is stuck, it sends.

Anyone have a good suggestion how to make sure the queue is not stuck?

http://devnet.kentico.com/questions/email-is-not-being-sent-consistently-in-kentico-no-errors-in-error-log-and-those-mail-does-not-show-in-email-queue

Recent Answers


Brenden Kehren answered on February 2, 2015 19:26

In v7, I simply created a scheduled task that performs the resend functionality because of this issue. Any client that needed to make heavy use of the email queue, I did this for. Below is the code, very simple and works every time.

    protected void ResendFailedEmails(ref string result)
    {
        try
        {
            if (!EmailHelper.Queue.SendingInProgess)
            {
                EmailHelper.Queue.SendAllFailed();
                result = "Completed successfully.";
            }
            else
            {
                result = "Send already in progress.";
            }
        }
        catch (Exception ex)
        {
            result = ex.Message;
        }
    }
0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.