Campaign Emails get stuck in queue

We are trying to send out some emails from the campaign module in Sugar and the emails get stuck in the email queue and never get sent. 

We have checked the different areas of the Sugar settings and can’t seem to find where the problem is. 

If we send a test email from within the Sugar SMTP test area, that is delivered without any problems and workflow emails are delivered without issue.

If we schedule a campaign and run, it gets stuck in the queue. Tests within the campaign don't even appear in the queue.

Here are some screenshots of the relevant areas. 


  • Hi Jessica,


    It looks like you've covered most of these scenarios, but I wanted to share an article from our Knowledge Base, Troubleshooting Campaigns Failing to Send From Email Queue which may provide some troubleshooting clues. Also, Creating a Campaign provides a comprehensive view of the campaign process from beginning to end which may also help to ensure all steps have been taken. 

    I hope this helps!
    Alex 

  • Yeah, we already tried going through these articles but couldn't figure out why it isn't working. Is there anything else that might cause this to not work? Note we host our instance of SugarCRM on a local server, not the sugarondemand cloud platform. Not sure if that makes a difference? 

  • Hi Jessica,

    If you are running on-site, you have the ability to set more verbose logging levels that should provide more insight on why the emails are failing to send from the queue. I recommend performing the following steps:

    1. Under Admin > System Settings, set the Log Level to 'Debug'
    2. Under Admin > Email Queue, update the existing messages in the queue so that they will send on the next scheduler run per the KB article linked by Alex.
    3. As soon as the campaign email scheduler processes, immediately set the logging level back to 'Fatal'. Leaving Sugar in a verbose logging state may hinder performance. Taking this action quickly will also reduce the amount of non-relevant messages you have to sift through. 
    4. Open the sugarcrm.log file located in the root directory of your Sugar installation. If you do not have file-level access to the server, you can also obtain this file by downloading the diagnostic output found under Admin > Diagnostic Tool.
    5. In the log file, search for the following string: "SchedulersJob calling function: runMassEmailCampaign". This will mark the initiation of the job processing the email queue. Comb through the log after that line until you get to a portion where the emails are individually processed. There should be an array output for each email it attempts to send in the queue, and within that array, a response/reason for the email failing to send should be included. (Note: If you cannot find the specified string in the file, then that means the log file likely rolled over due to the size of the file exceeding your settings. In that case, you will need file-level access to review one of the rollover logs located in the same directory as the sugarcrm.log file. These logs are numbered sequentially as sugarcrm_1.log, sugarcrm_2.log, etc. where the lowest number is the most recent roll over.) 

    If you are unsure on how to interpret the response, let me know what info you find and I will do my best to assist.

    Good luck!

  • I got a solution that looks some tricky but works for me many times. This will need direct DB access.

    You will need to run this sql if you think your emails are getting stuck in queue for any reason.

    As i said , this is just a trick for me , it will not solve a real problem.

    "update `emailman` set in_queue=0;"
    "update `emailman` set send_attempts =0;"