mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Campaign Emails are queued, but it stops sending after about 78 or 79 recipients #1301
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#1301
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @gitnito on GitHub (Oct 3, 2016).
Issue
Our campaign emails are all queued, but only about 79 or so are actually sent. PHPMailer fails after that number with an SMTP connect error. The "Number of emails sent per batch" setting under "Campaign Email Settings" is set to 500, and changing it does not affect anything. There are no limits on the SMTP account used (Google Apps for Work), and other applications are able to send thousands of email from the same account with no problem. If you go to the email queue, and click on "Send Campaign Queued Emails", it returns back immediately with no email sent, and nothing logged to the "suitecrm.log" file. Deleting the emails from the queue, and re-sending the campaign will send another batch of 79 or so (this basically proves the issue is NOT with the email account), however this is not a viable workaround, since it corrupt the campaign statistics by marking all of those emails as "Bounce Messages, Other". If the emails are left in the queue, they are continued to be sent at 10:00pm (where is this setting?) every day in batches of 79 or so.
Expected Behavior
When you click on send emails on a campaign, it should send all the emails up to "Number of emails sent per batch" setting under "Campaign Email Settings".
Actual Behavior
All emails are queued to be sent, but only about 79 emails are sent before PHPMailer starts filling the "suitecrm.log" file with the following errors one per failed email:
`Fri Sep 30 07:35:55 2016 [16301][d7def37c-25bd-194a-379a-57903117762f][FATAL] SugarPHPMailer encountered an error: The outbound mail server selected for the mail account you are using is invalid. Check the settings or select a different mail server for the mail account.
Fri Sep 30 07:35:55 2016 [16301][d7def37c-25bd-194a-379a-57903117762f][FATAL] SugarPHPMailer encountered an error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Fri Sep 30 07:35:55 2016 [16301][d7def37c-25bd-194a-379a-57903117762f][FATAL] Email delivery FAILURE:Array
(
[date_entered] => 2016-09-30 11:14:30
[date_modified] =>
[user_id] => d7def37c-25bd-194a-379a-57903117762d
[id] => 1563
[campaign_id] => ad50fd79-54c7-66d2-b3bf-57ede1a6a93e
[marketing_id] => 85f8fbdc-2cbf-d8e8-3634-57ee40c0d640
[list_id] => 206c8d0b-a311-0750-8f5f-57ed2a9692cc
[send_date_time] => 2016-09-30 11:15:00
[modified_user_id] =>
[in_queue] => 0
[in_queue_date] =>
[send_attempts] => 0
[deleted] => 0
[related_id] => e48baf5c-ece9-39ce-cdf6-57ed295f2820
[related_type] => Prospects
)
Fri Sep 30 07:35:55 2016 [16301][d7def37c-25bd-194a-379a-57903117762f][FATAL] Email delivery error:Array
(
[date_entered] => 2016-09-30 11:14:30
[date_modified] =>
[user_id] => d7def37c-25bd-194a-379a-57903117762d
[id] => 1563
[campaign_id] => ad50fd79-54c7-66d2-b3bf-57ede1a6a93e
[marketing_id] => 85f8fbdc-2cbf-d8e8-3634-57ee40c0d640
[list_id] => 206c8d0b-a311-0750-8f5f-57ed2a9692cc
[send_date_time] => 2016-09-30 11:15:00
[modified_user_id] =>
[in_queue] => 0
[in_queue_date] =>
[send_attempts] => 0
[deleted] => 0
[related_id] => e48baf5c-ece9-39ce-cdf6-57ed295f2820
[related_type] => Prospects
)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting`
Possible Fix
Some PHPMailer setting or bug.
Steps to Reproduce
Context
We rely heavily on email campaigns for our customers to find our product; which they need, but do not know it exist. Thus, email campaign are our primary source of marketing, and this issue directly and severely limits our ability to generate new leads, and hence our daily sales.
Your Environment
@shogunpol commented on GitHub (Oct 17, 2016):
@gitnito , just ask about additional info: can you check if outbound server has a limit of sended emails?
@ijdavie commented on GitHub (Oct 17, 2016):
@gitnito there is a limit to the gmail servers, it is higher than what you are seeing here. is there a possibility that the gmail server is refusing the amount of emails in such a small period of time ?
@gitnito commented on GitHub (Oct 28, 2016):
@shogunpol I had the problem happen with the limit set to the default of 500, and it still happened when I changed it to 1000. Recently I tried it setting it to 50, and surprisingly this made it better. Emails where sent without failure, but not continuously, since it did it in batches of 50 (which well below the 75-80 at which it would fail before). If I had to guess, it seems to me that the underlying PHPMailer must have a limit or some failure check around the 75-80.
@gitnito commented on GitHub (Oct 28, 2016):
@ijdavie I have had quite long conversation with Google support engineers that can directly look into my account to see if any limit was being triggered, and they tell that did not happened. My gmail account is a Google Apps for Work account, and the only limit is has is a 2500 unique recipients per rolling 24 hr. Further, I have used mail merge under Mozilla Thunderbird with the same gmail account to continuously send thousands of emails at a fast rate with no problems other than the 2500/24hr limit. Thus to answer your question; no, I don't think there is any issue with the gmail account (in fact I know for a fact, since Google engineers looked into my account status while this was happening, and said there was no issue on their end).
@chris001 commented on GitHub (Oct 28, 2016):
@gitnito As a workaround,, you should set the "Number of emails sent per batch" to 50 per batch, and set it to send as often as something like one batch per 5 minutes.
@gitnito commented on GitHub (Oct 28, 2016):
@chris001 That is what I have been doing. But I don't remember if I changed the frequency of batches. Where would I change that?
@chris001 commented on GitHub (Oct 29, 2016):
@gitnito
Admin / Schedules / Run nightly mass email campaigns.
Hit Edit.
Change
Interval Min.from0,10,20,30,40,50to*/5for every 5 minutes. Or, do*/2for every 2 minutes. Or, do*for every minute.Change
Interval Hrsto2-18this is 24 hour time, corresponds to 2am-6pm.Hit Save.
Try it out, it should work.
@shogunpol commented on GitHub (Nov 2, 2016):
@gitnito , it is very possible the problem what causing the malfunctioning of the email campaigns it can be using PHP7, because is very difficult to replicate an issue for me, can you check is this issue appear after using lower version of PHP?
Thanks for your contribution.
@gitnito commented on GitHub (Nov 2, 2016):
I am using PHP Version 5.6.27-0+deb8u1, and I can not change it.
@ijdavie commented on GitHub (Nov 2, 2016):
@gitnito just a thought with this, could this be down to the hosting provider for the CRM. I wonder if it may have something to do with amount of connections the server will allow ?
@chris001 commented on GitHub (Nov 3, 2016):
@ijdavie Good question. So then, how many simultaneous SMTP connections does phpmailer library, the sugarmailer class, and the Campaigns module, require from the smtp server, in order for the Campaigns scheduler to run without error?
@ijdavie commented on GitHub (Nov 4, 2016):
@chris001, I would have thought that the phpmailer library wouldnt have a issue with this and more so with the server it sits on so I mean if the server picks up that something is trying to send XXX amount of emails after so many requests it stops this due to it thinking it is not normal. @chris001 have you been able to replicate this issue ?
@chris001 commented on GitHub (Nov 5, 2016):
@ijdavie @gitnito @shogunpol With an hour of digging into the code, I created Pull Request #2569 which should make the Campaign Emails send a lot better when your SMTP outgoing email server is complaining because you're putting it under high load from sending too many emails in per batch.
If you would, try it out and report back to let us know if your issue is solved.
@amariussi commented on GitHub (May 25, 2018):
Instead of hard coding it in the code it would be better to use a config field so that anyone can decide whether he wants or not to use this approach, which, according to many, may lead to be signaled as spammers for various reasons.
It's only a matter of making a very small change in the if statement.
@Mausino commented on GitHub (May 25, 2018):
@amariussi i agree too. it should lead to problems like here #3423 SMTP Spamming