CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • "Send Mail to Contacts" creates multiple mailers
Pages: [1]

Author Topic: "Send Mail to Contacts" creates multiple mailers  (Read 2022 times)

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
"Send Mail to Contacts" creates multiple mailers
September 28, 2009, 06:32:09 am
I'm trying to use the "Send Mail to Contacts" function as already stated here:
http://forum.civicrm.org/index.php/topic,9957.msg43015.html#msg43015

What happens on a fairly regular basis is that I press the "Send" button once, but two activities are created! The time difference is approx 1min.

I'm trying to send an email to 50 contacts per go. Does this mean that the emails are really sent twice?!

This would be really bad since this is a "first contact" mailer and getting such an email twice will not really "create happy new customers". :(

I looking forward to some feedback about this problem.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 07:22:03 am

1. I would check the apache logs and drupal watchdog and see if i get any error messages

2. i would also check the mail log to see who those messages were sent to and try to find a correlation

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 07:30:52 am
Quote from: Donald Lobo on September 28, 2009, 07:22:03 am

1. I would check the apache logs and drupal watchdog and see if i get any error messages

2. i would also check the mail log to see who those messages were sent to and try to find a correlation

lobo

The logs don't show anything related to the email sending. Also I don't see any correlation in the email addresses.

What I see repeatedly though is the following scenario:
-) I try to send 50 emails
-) 38 get sent (the number differs of course)
-) I remove the 38 contacts from the todo list
-) I try sent the next 50 emails, 0 are sent
-) I delete the first email from the list
-) I try to sent 50 emails again, it works

How can it be that CiviCRM gets stuck on an email address?

Second scenario:
-) I try to send 50 emails
-) It sends 10 emails, one minute later it opens a new activity (on it's own!) and tries to send emails again
-) The second try sends either the full 50 emails, or gets stuck as describe above

Why would CiviCRM try to send the emails again?

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 08:03:36 am

if i had to guess your hosting provider has some limits on smtp activity and hence u r seeing the behavior below. I suspect it blocks/holds/rejects smtp connections based on a few parameters

civicrm is deterministic code as far as we know. so the same scenario should have the same effect in all cases and not change from run-to-run

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 08:18:35 am
hmmm ... I just had scenario #3:

-) I scheduled my 50 emails

Quote
id      mailer time                 emails sent
90     2009-09-28 08:01:14   1
89     2009-09-28 08:00:13   15

-) shortly after that I rescheduled the mailing after deleting the first 15 contacts that received the 15 emails (1 emails seems to have been sent twice). I didn't delete the first contact from the todo list as explained in my previous posting. Now I get the following duplicate activities:

Quote
id      mailer time                 emails sent
92     2009-09-28 08:06:38   1
91     2009-09-28 08:05:35   50

As I was tracking the activity through phpMyAdmin, the number of emails on mailing #91 was around 10 when I first viewed it, and mailing #92 was already there with one sent email. Then the number of emails on mailing #91 was subsequently rising to 50.

So apparently the email was sent to the contact the "interrupted" the previous "set of mailers" on the second try.

I still don't understand why CiviCRM will create two activities although I definitely press "Send Email" only once.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 08:30:32 am

what is the name of the table in your post above. I dont think civicrm has a table like that in the schema :(

also send email to contacts, does not create a job, it sends directly via the SMTP server


lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 08:34:01 am
I have written myself a query for phpMyAdmin to monitor the mailings:

Quote
SELECT a.id, a.activity_date_time, COUNT( t.activity_id ) AS emails
FROM civicrm_activity a
  LEFT JOIN civicrm_activity_target t ON
    t.activity_id = a.id
WHERE a.id >= 8 -- id I started with around 1 week ago
GROUP BY a.id, a.activity_date_time
ORDER BY a.id DESC

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 09:02:53 am

no idea what is happening and why. You'll need to dig into the code and help us debug and figure out whats happening

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mac

  • I post occasionally
  • **
  • Posts: 71
  • Karma: 0
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 09:13:06 am
I have another problem now. According to CiviCRM I sent 440 emails today (including emails sent to a contact more than once):

Quote
SELECT SUBSTRING( a.activity_date_time, 1, 10 ) AS DAY, COUNT( DISTINCT a.id ) AS mailings, COUNT( t.activity_id ) AS emails
FROM civicrm_activity a
  LEFT JOIN civicrm_activity_target t ON
    t.activity_id = a.id
WHERE a.id >=8
GROUP BY SUBSTRING( a.activity_date_time, 1, 10 )
ORDER BY SUBSTRING( a.activity_date_time, 1, 10 ) DESC

But according to goDaddy I already used 1000 relays today! That basically means that for every email I seem to send through CiviCRM, I'm using two relays. :( Is there any reasonable explanation for this? Is there maybe something wrong with the query I wrote?

In terms of digging into the code:
1) Please let me know what exactly I should check, debug, etc.
2) I won't be able to sent any emails today any more since I have to wait till new 1000 relays become available tomorrow. :(

I tried to check the log:

Quote
SELECT *
FROM `civicrm_log`
ORDER BY id DESC

But also in there I see all activities doubled and I don't see a difference between "the ones that should be there and the ones that fell from the sky".

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: "Send Mail to Contacts" creates multiple mailers
September 28, 2009, 10:48:02 am

All the mail is sent from:

CRM/Utils/Mail.php, function send

I have no idea what godaddy's defintion of a relay is. You might want to consider getting a better hosting plan and a larger email bucket. Please let us know your findings

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • "Send Mail to Contacts" creates multiple mailers

This forum was archived on 2017-11-26.