Email not received
Heilong - June 9, 2009 - 10:38
| Project: | Rules |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | postponed (maintainer needs more info) |
Jump to:
Description
Hi everyone,
I have several triggered rules which use the email function to notify users or administrators of changes on nodes. I checked the log reports and everytime a rule is executed the mail is logged as "successfully sent to..." .
But the recipient doesn't get any emails, i'm thinking maybe I missed something in the settings...
Need help thanks,

#1
I'm getting exactly the same problem, the logs show the rule being triggered but no e-mails are being sent through. Has anyone come up with the same problem? Or indeed even better a solution.
I'm trying to send e-mails to the current user and a fixed e-mail on the creation of a specific content type.
#2
There are 3 email actions, exactly, which one do you use?
The one I use works... (i.e. "Send a mail to an arbitrary mail address")
Thank you
Alexis Wilke
#3
I have 2 different rules using these 2 different actions : "send a mail to all user of a role" mail which is sent to the administrator, and "send a mail to an arbitrary mail address" which is sent to a user I got from a cck field.
Is there any mail method associated to rules ?
#4
The "send a mail to an arbitrary mail address" can be used with a direct email address which is what I use and that works for me.
I don't use CCK on that site so I could not test that right now. But for the role it looks good to me. It uses the drupal_mail() function. Maybe that does not work? Did you try to send yourself an email from your /contact form to see whether the mail flows alright?
#5
**Subscribing**
#6
I'm using Webform module for my contact page, it's working, emails are sent and received properly. it doesn't work only for Rules
#7
Since this isn't a known bug, the email actions should work fine. Please verify that your system can send emails using one of Drupal's internal features, such as "notify the user of the newly created account."
I'm guessing the problem is that your webserver is not configured to send emails, whereas the smtp module is a helpful workaround.
If you still need help with this, please reopen this issue and post an export of your rule.
#8
mitchell,
#6 says that it works for him from Webform, but not from Rules... I'm not too sure why it would be any different, but that means there is something that does not work there.
Alexis
#9
I'm having a similar problem with "Send a mail to an arbitrary mail address" no emails are sent, no errors are logged. No success messages are logged either, I'm not sure where things are failing.
I'm running Rules and Token.
*edit* by changing the weight of this action to -2, my emails now send. very strange!
Jen
#10
Be careful with *immediate* page redirects, I suppose they are the cause for your troubles.
#11
I have experienced the same issue on two different sites now that I am working on. Neither are configured with the same modules and were installed individually.
I am using Rules configuration as follows:
Conditions
Created content is Some Content Type (created content)
AND
User has role(s) indent (acting user)
Actions
Send a mail to a user (acting user)
Add user role (acting user)
Remove user role (acting user)
Show a configurable message on the site
My issues is, for all intents and purposes, the same as described above - but my issue seems to be intermittent. I've created twenty or so new nodes and have received the email notification twice. I was hoping I could replicate these two successful emails to narrow down the problem by creating new nodes with the same data in title/body/cck fields as the two that actually went out, but this attempt also failed at sending emails.
I tried creating new Drupal accounts and received the account creating confirmation email. The site's contact form works properly as well. Furthermore, I have a number of other websites also running on this server and they have no problem sending their emails. Some of these are using workflow-ng on Drupal 5.x and it also works fine.
I tried switching email addresses in my test user account to see if it was the email and not Drupal. I tested three different email addresses for three different email servers (one was even Gmail). It doesn't seem to be on the recipient end.
I tried the aforementioned "-2" rule weight hack that jenlampton mentioned about in #9. I didn't have any success with this. Additionally I tried setting the "Send mail to a user" Action's weight to "-2" and that didn't solve the problem either. Maybe it was just intermittent success for her?
I also tried switching around the Action weights so that the "Send mail to a user" Action comes first or comes last - didn't make a difference.
Additionally, the "Successfully sent email" shows up in my Drupal log.
Thanks, Robert
#12
Hm, does the "Successfully sent email to " message hold the correct recipient? If so everything should have been fine, meaning that the mail was correctly sent by drupal_mail().
#13
Yes, the recipient is correct in the log. And as mentioned above, infrequently the email is actually delivered.
#14
I have this same issue as the original post. I note this issue is tagged as 'fixed'? Where is the fix please?
#15
There is none. @Patrocias: Does mail sending else work fine on your site? Are you using php4?
For me mail sending works fine - so if there is a bug in rules mail sending you should try to reproduce the problem and to identify the cause. As when I can't reproduce it, I've no way to find the problem and fix it.
#16
My site is sending emails from everything except rules.
I have configured a 'Send a mail to an arbitrary mail address' to send when content of a specific type is created.
I have removed all tokens from the configuration just to test it.
I have log entries showing successful sends, but nothing is being received.
The 'from' address is left as the site default.
The To: address is correct and is the same as for other successful messages.
There are no errors in my server logs.
Here is the rule
array ('rules' =>
array (
'rules_18' =>
array (
'#type' => 'rule',
'#set' => 'event_node_insert',
'#label' => 'Issue report',
'#active' => 1,
'#weight' => '-2',
'#categories' =>
array (
),
'#status' => 'custom',
'#conditions' =>
array (
0 =>
array (
'#type' => 'condition',
'#settings' =>
array (
'type' =>
array (
'report' => 'report',
),
'#argument map' =>
array (
'node' => 'node',
),
),
'#name' => 'rules_condition_content_is_type',
'#info' =>
array (
'label' => 'Created content is Report an issue',
'arguments' =>
array (
'node' =>
array (
'type' => 'node',
'label' => 'Content',
),
),
'module' => 'Node',
),
'#weight' => 0,
),
),
'#actions' =>
array (
0 =>
array (
'#weight' => 0,
'#info' =>
array (
'label' => 'Send a mail to an arbitrary mail address',
'module' => 'System',
'eval input' =>
array (
0 => 'subject',
1 => 'message',
2 => 'from',
3 => 'to',
),
),
'#name' => 'rules_action_mail',
'#settings' =>
array (
'to' => '[email address removed]',
'from' => '',
'subject' => 'Isssue report',
'message' => 'Content',
),
'#type' => 'action',
),
),
),
),
'rule_sets' =>
array (
),
)
Would appreciate any help on this - thanks for your quick reply.
#17
hm, I still cannot reproduce it. I configured the action like yours but everything works fine. Do you have any modules installed that might hook into it and alter the mail? Is it working on a clean drupal install only having rules activated?
#18
Have you access to the server logs, does the mail appear there as others?
#19
Nothing helpful in the logs. I will assume this is a problem somewhere on my system and take a further look. If I find anything I will report back here.
Thanks for your help.
#20
I too am not receiving emails when I've instructed the event to send emails to all users in a role. Yes, this is on the "account create" condition and yes, I do have redirect as the last action. And yes, "Immediately issue the page redirect" is unchecked.
I added a "send to an arbitrary address" action to send to another one of my email address and that didn't work.
Then I removed the redirect action and then I got the email from the arbitrary email address action -- but not the "send to all users of this role" -- and yes -- there are two users in that role and they are valid email addresses.
(It should also be said that I'm seeing nothing in the recent activity log -- not even the successful send. I've checked the Rules config screens and I don't see anything turning on log messages -- though that would be *very* useful.)
So then I added a new redirect action and tested. OK, I am still getting the arbitrary email which is good but not getting the role email. (I am also receiving the standard notifications from Drupal that a new account was created.)
Next, I added a token to the body of the arbitrary email from one of the Content Profile nodes I had previously loaded --- yeah -- a small detail I left out! ;-) Then I tested and I *didn't* get the email. Huh, the token is the problem. Oh yes, the email that is supposed to go to the role is full of tokens, so we may be on to something here.
I then removed the token from the arbitrary email and tested. I didn't get the message. So, if it's being corrupted, it's being corrupted for good. I removed the email action and added a new one, tested and I received that one.
So, my conclusions at this point is that there is something wrong when including tokens.
#21
Getting very similar issues to those reported above, repeatable issue:
1. Creating a rule which notifies all users in a role upon a condition being met works fine when tested.
2. Add token values to the mail, the rule keeps working but the mail is no longer sent.
3. Add a new action to sent an email to someone (no tokens), new mail action works (old one still fails).
4. Add token values to body, mail fails again.
In all stages all other actions in the rule work correctly, the log does stop getting the "mail successful" event logged at the point mail stops working.
This is 100% repeatable for me and *only* where tokens are added to the mail to be sent.
In addition, removing tokens from the body does not repair the action, and it has to be deleted.
Kind regards,
Danielle
#22
Does it depend on the token you are using or does it fail with any token? Does token replacing work elsewhere, e.g. when outputting a single message? Please also test whether the bug is in the latest version too.
#23
I'm having better luck with the DEV version that I downloaded this morning, but my real problem has nothing to do with a bug.
Per my previous comment:
The token is not the problem. The problem is that my rule is fired off when a user is created. The problem is that when my Content Profile nodes have not yet been created so the rule is bombing out. It's on that the tokens aren't merged, it's that the rule is failing to run to completion. If it was simply a token problem, I would receive the email without the tokens merged. It would be nice if the module wrote an error to the log so that we could see that the node that was to be loaded couldn't be loaded. If the rule bombs out after that, fine.
So it would seem that I don't have an Event defined in Rules that will allow me to load content from Content Profile nodes at the time the user is registering and creating the user. What about triggering the email after the last Content Profile node is created (I am creating three during registration)? That works if you only need tokens from the last node, but I haven't been able to load another Content Profile node in that rule. I'm assuming that this is because the acting user is anonymous and doesn't have a user ID, so trying to load a Content Profile node as the Acting User or the Content's Author doesn't work.
One solution may be to do a page redirect with the uid appended to the end and then do node loads using that arg? Seems hackish.
We may be getting out of scope here as far as this issue goes. Let me know and I'll gladly submit a the appropriate issues to the queue.
#24
Subscribing, greetings, Martijn
#25
I have the same problem.
running on vista using a tool called "antix smtp server for developers".
I pipes the email to a file.
In the email [To] field I get [none] as the recipient.
It's suppose to use the userObj [user].
Don't know why.
In the configuration screen for rules
ie.
http://localhost:85/admin/rules/rules/rules_3/edit/3?destination=admin/r...
There is no option to set the receiver, so supposedly it gets it from the [user] object.
it is not working for me.
Maybe all these issues are windows related?
do not know why?
Ed