6.x-1.x-dev (2008-May-11)

Sending of tokenised email for new comments is not working, no email is sent. After saving a comment the message at the top of the page is

Unable to send e-mail. Please contact the site admin, if the problem persists.

Checking the 'Recent Log Entries' page the following log entries are recorded, listed in time ascending order (oldest first)
1, Error sending e-mail (from admin@prime357.org to new comment - tokenised).

2. Sent email to admin@prime357.org (which I never receive)

3. Comment: added Token module uploaded.

It appears from this that the token module is trying to send an email about a new comment before the comment is actually saved.

Also note in 1 above, the subject line of the tokenised email is used rather than the senders email address (this is following on from this thread - http://drupal.org/node/242944#comment-837529

Comments

Dave Reid’s picture

What's happening is that the drupal_mail function added a parameter between API 5 and 6.

Here's the current call in token_actions.module:
drupal_mail('action_send_email', $recipient, $subject, $body, $from )

From http://api.drupal.org/api/function/drupal_mail/5
drupal_mail($mailkey, $to, $subject, $body, $from = NULL, $headers = array())

From http://api.drupal.org/api/function/drupal_mail/6
drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)

Since the function call hasn't changed in the Token 6.x code, the $to is being used as $key, $subject being used as $to, $body as $language, etc. I'll try to get a patch set created.

greggles’s picture

Status: Active » Closed (duplicate)

Thanks for the report and for your investigation.

Please see #253094: "Unable to send mail" with send tokenized e-mail which has an attempt at a patch for this. Your assistance to test/fix it is appreciated.