I install the last version and when i send a mass contact mail the mail dont send.
The module reports that the mail was send to all of the users but never arrives.

What is the new profile field option? am I forget something?

Comments

NoahY’s picture

First of all, check whether you are administer of the site. If you are, it should have nothing to do with the profile field checkbox. It might then be a bug in the code, or a problem with your site.

If you are only a regular user with a role which is permitted to send mas mailings, then it might be that none of the users you wish to send to have opted in to the mass mailings.

Please try checking your site logs to see if any errors come up when you send the mail. Make sure you have assigned the people you want to send the mail to to the role(s) you have selected in your mail category.

xman’s picture

I am the administrator (user 0). I uninstall a install again the module. I try to send a mail again and same result.
My site is multisite multidomain. The log shows the mass_contact event with no errors. The content type mass_contact node (no publish) saves correct.

I don't know what happens.

NoahY’s picture

Are you sure the emails are not being sent and detected as junk by the receiver?

I can't imagine what the problem is; if it says that the mail is sent, it should have been sent.

If you're absolutely sure that the mail is not being sent, try this. Replace the following line (should be line 516) of mass_contact.module:

drupal_mail('mass-contact-page-mail', $to, $subject, $body, $from, $headers);

with this:

drupal_set_message("to: $to, subject: $subject, body: $body, from: $from");

and then send a mass contact, making sure the bcc checkbox is not checked. Let me know what the output message is after you're redirected to your homepage.

xman’s picture

I replace the line and then send a mass_contact. The result page was:

- to: user 1, user 2, user 3, ...and the mail content.
- Your message has been sent to: user1, user2, user3,...
- A carbon copy has been created as a node.

The mail not send. I check the spam folder also.

NoahY’s picture

Sorry, I forgot that I what I was requesting would have you divulge private emails on this site. Remember to change that line back to the original for the script to work.

I can only think that maybe the php on your site doesn't allow mail? Try this:

change that same line to read:

$mailsentok = drupal_mail('mass-contact-page-mail', $to, $subject, $body, $from, $headers);

and add two lines right after it:

if ($mailsentok) drupal_set_message('Mail really sent!');
else drupal_set_message('Mail not really sent!');

If the mail is not sent, it could have to do also with problems in the format of the email addresses or the subject. As per the drupal_mail api:

$mailkey A key to identify the mail sent, for altering.

$to The mail address or addresses where the message will be send to. The formatting of this string must comply with RFC 2822. Some examples are: user.com user.com, anotheruser.com User User , Another User

$subject Subject of the e-mail to be sent. This must not contain any newline characters, or the mail may not be sent properly.

$body Message to be sent. Drupal will format the correct line endings for you.

$from Sets From, Reply-To, Return-Path and Error-To to this value, if given.

$headers Associative array containing the headers to add. This is typically used to add extra headers (From, Cc, and Bcc). When sending mail, the mail must contain a From header.

xman’s picture

I think I found my error (PHP 4.4.4)

In these lines...

494.	foreach ($recipientouta as $rnamea=>$rmaila)
495.	{
496.		$recipientout[] = $rnamea." <".$rmaila.">";
497.	}
498.	$recipientout = implode(', ',$recipientout);

The result of $recipientout[] = $rnamea." <".$rmaila.">"; must be:

user1 <user1@mail.com>

And in my drupal installation the result is:

user1

This make the "Bcc" header section like this:

user1,user2,user3, ...

Without the email adresses, and the mails don't send.

Temporary (I am investigating) I change this line:

496.		$recipientout[] = $rnamea." <".$rmaila.">";

For this:

496.		$recipientout[] = $rmaila;

And Bcc header section looks like:

user1@mail.com,user2@mail.com,user3@mail.com,...

NoahY’s picture

Ah, yes. I should have caught on when you said the output was user1, user2, etc. I wonder why the email addresses are not being posted when you leave the line as it is. This is beyond me. But it should make no difference to the overall script if you change the line 496 as you have. If that works, go for it, until you can figure out the real problem. I'm using PHP 4.4.4 as well, no problem here.

xman’s picture

Yes, it works for me. I sent my first mass_contact mail and now works (106 bcc recipients).
I don't know why line 496 don´t works. If I found the fix I will tell you.
It's very stranger.

huayen’s picture

Finally any solution to completely solve this problem? I also have this problem.

NoahY’s picture

Does it refuse to send both

a) when you are sending to a category with all authenticated users, and

b) when you only send it to a role with a few select users?

Or only one of the above?

xman’s picture

My case is a)

NoahY’s picture

Try the new version 1.3 when it appears, and set a limit on the number of recipients via the module settings page (try a low number first). The problem may have to do with php mail limits imposed by your server.

xman’s picture

I found the 1.4 version. it's the same?

If I put a lower number, what happens with the other users? How can I send a mail to them?

Thanks for all.

NoahY’s picture

It sends to all users, just splits up the send routine so that it doesn't hit the php limit on your server. You should see in the message after you send:

[Success] Send #1: user1 <>, user2 <>, etc.
[Success] Send #2: user3 <>, user4 <>, etc.
...
[Success] Send Remaining: user2ndLast <>, userLast <>

and then a message telling you that it was successfully sent to how many recipients.

seedseller’s picture

Version: 5.x-1.x-dev » 5.x-1.5

I've just installed this module and all seems to go as advertised, except that the emails don't actually ever get sent. I have had similar difficulties with other modules hat do email and found that I needed to use the returnpath module. Is this somehow not working with the returnpath module as it should? Or is there something else?

Thanks.

dadilleh’s picture

Okay-- I read through this and realized I am in way over my head. This is my first experience with anything this heavy as far as programming/etc., someone helped me set up the site and I built it by myself using Drupal... I'm having the same problem; I get "1 Error...blablala....view the logs for more info" But of course it doesn't show up in the logs. I don't know how to edit the code you guys were showing; I found it in my File Manager but I don't know how to edit it. Is there a better way to fix this? Or do I need some more serious help?

arzajac’s picture

Hello.

My mass-contact was working fine, but now my users report no errors, but the mails don't get sent.

In the process of debugging, I changed the max number of users before breaking up email to 2 (from 0) and I waiting to see if this has any effect.

I get an error that I don't think I used to get before, though. If I tick use Bcc, I get no errors, but without Bcc, I get the error message:

* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/webusers/apqiadmin/apqi.com/www/includes/common.inc on line 1929.
* warning: Invalid argument supplied for foreach() in /home/webusers/apqiadmin/apqi.com/www/includes/common.inc on line 1962.
* warning: array_merge() [function.array-merge]: Argument #2 is not an array in /home/webusers/apqiadmin/apqi.com/www/includes/common.inc on line 1929.
* warning: Invalid argument supplied for foreach() in /home/webusers/apqiadmin/apqi.com/www/includes/common.inc on line 1962.

Before the email sent message:

* [Success] Send #1: (Names and email addresses)
* [Success] Send #2: (names and email addresses)
* Message sent successfully to 4 users: (names and email addresses...)

Also, some messages are being sent (ones I send as the site admin) but some characters are being mangled. Previously, french accents were being handled properly. I am sure this is a PHP setting on the server, but could this be also affecting the sending of emails though php?

Example of mangled characters:

Andrew sent out a mass e-mail from http://*****/. J'envois ceci seulement à l'exécutif. Je suis désolé de l'inconvénience. Je test le courriel du site... Répondez-moi si vous recevez ce message, svp.

Thanks.

arzajac’s picture

Five days after I sent out a bunch of test email, I received a failure notice from my ISP. Perhaps character encodings are the problem?

Hi. This is the qmail-send program at *****.net.
I'm afraid I wasn't able to deliver your message to the following
addresses.
This is a permanent error; I've given up. Sorry it didn't work out.

<**@***.ca>:
Connected to **.***.***.** but greeting failed.
Remote host said: 452 try later
I'm not going to try again; this message has been in the queue too
long.

--- Below this line is a copy of the message.

Return-Path:
Received: (qmail 22236 invoked by uid 48); 7 Jun 2007 00:14:04 -0000
Date: 7 Jun 2007 00:14:04 -0000
Message-ID: <20070607001404.22235.qmail@****.net>
To: *** <***>,
*** <*****>,
**** <*****>,
*** <*****>,
Subject:
=?UTF-8?B?W2V4w6ljdXRpZl0gw4lyaWMsIGplIG1ldCB1biBob21tZSBsw6AtZGVzc3VzLiA=?= =?UTF-8?B?IEplIHRlc3QgY2EuLi4u?=
MIME-Version: 1.0
Content-Type: text/html
Content-Transfer-Encoding: 8Bit
X-Mailer: Drupal
Errors-To: arzajac@****.ca
Reply-To: arzajac@******.ca
From: arzajac@****.ca

Andrew sent out a mass e-mail from http://****/.

J'envois ceci seulement à l'exécutif.

Je suis désolé de l'inconvénience. Je test le courriel du site...

Répondez-moi si vous recevez ce message, svp.

marcbe’s picture

I also recently started to have problems with that module which stoped sending anything and giving the infamous error message.

It was working fine as long as I was testing my web site from a URL such as http://mydomain.com/sitename

The other day, we migrated the test site to the final domain http://sitename.com and mass contact stoped working from that point.

This is really odd as it seems to be related to some path / URL change. The call to drupal_mail() seems to be returning with an error looking at the code, but if I try a single user with the "contact" tab (which also use drupal_mail), then it sends the Email fine. So it really seems to be the parameters passed to the drupal_mail() function itself that is the problem.

Any clues?
Thanks
Marc

oadaeh’s picture

Hello all.

I have recently taken over maintainership of this module, and I'm currently going through all the open issues.

Is this issue still valid?

xman and huayen, that is a bizarre problem. The only thing I can currently think of as a possibility is that your problem might be caused by a mail server configuration setting. I'd need a little more information and to do a little research before I know for sure.

dadilleh, your problem is different from what was originally reported. Your problem might be a bad e-mail address or exceeding a limit on the mail server or in PHP's mail configuration. If you're still having problems, please open a new issue.

arzajac I believe dman posted a patch (http://drupal.org/node/160717) to fix some or all of the problems you are having, so after a bit of testing, I'll hopefully have something in for you in the next week or so, time permitting.

marcbe your problem is also different, and I'm not entirely sure what it is. I will need some more information and to investigate further. If you're still having problems, please open a new issue.

If I get no responses in the next two or three weeks, I'll just close this issue.

cmadsen’s picture

I've installed the mass contact module and it just sends to one user instead of everyone for a given role, although it says that all sends were successful. I'm testing it on a role with just 2 users at this time. I am able to send to single users through the regular contact module. The mass contact error message is:

warning: array_merge() [function.array-merge]: Argument #2 is not an array in C:\Program Files\xampp\htdocs\drupal\includes\common.inc on line 1929.
warning: Invalid argument supplied for foreach() in C:\Program Files\xampp\htdocs\drupal\sites\all\modules\smtp\smtp.module on line 175.

My appologies if there's already a fix and I haven't understood how to apply it. I did try designating "$recipientsouta = array();" in the mass_contact.module file but that didn't help. Thanks in advance for your help.
Chris

oadaeh’s picture

@cmadsen, I've put the fix for the array_merge problem in the most current 5.x.2.x CVS source. I hope to have an official release out soon. The suggested fix of adding $recipientsouta = array(); was incorrect.

I'm not sure about your other problem, though. There are lots of variables that are wide open. Also, it looks like the error is coming from a different module, so maybe that's where your problem lies.

Try the newer version of the Mass contact module and see if it fixes your problem. If not, please open a new issue with more details.

oadaeh’s picture

Status: Active » Closed (fixed)

No response in a very long time.

If this is still not working for you, install a newer version and try again. I'm planning on releasing 2.4 soon, which should be better than 2.4-beta.

bambangfals’s picture

i have error use this module, error message like this

    * cid = "3"
    * 1 errors encountered sending message. Please check the logs and try again.

Please everyone, help me...

oadaeh’s picture

@bambangfals, please open a new issue or post on a relevant one. This issue has been dead for a long time and has nothing to do with what you are seeing. For your problem, try here: http://drupal.org/node/241767

gopagoni’s picture

Title: My mass contact mails don't send » Need Help
Assigned: Unassigned » gopagoni
Category: support » feature
Priority: Normal » Critical
Status: Closed (fixed) » Active

Hi,
This is Narsing.Iam new to drupal.Iam using mass_contact module but i don't know how to use it.please kindly provide me any documentation regarding usage of the module.
I tried it but iam confused with the node/add/mass-contact form.When i submit it where it will send the mail.
there i didnt find any option of (to:) and event the categories or the groups.

Iam very sorry that iam very poor at English.

Narsing

oadaeh’s picture

Title: Need Help » My mass contact mails don't send
Assigned: gopagoni » Unassigned
Category: feature » support
Priority: Critical » Normal
Status: Active » Closed (fixed)

@gopagoni: Please create a new issue rather than hijacking an existing one that has nothing to do with yours.