Hello,
I'm running:
drupal commons 7.x.3.2
message notify 7.x-2.3+3-dev
I create a new post to a group which I follow and have email notifications turned on.
I receive the notification email as expected.
However, I also get the error message (in the log file): Could not send message using @title to user ID 8.
and printed to the screen "Unable to send e-mail. Contact the site administrator if the problem persists."
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | message_notify_46chars_change_subject.png | 28.88 KB | WebSinPat |
Comments
Comment #1
madhattertech commentedHello, I have the same issue.
Comment #2
8bitplateau commenteddont know why your're getting the error but its not very helpful messge! line 101 in abstarct.inc
should be
or @label @label - donesnt matter.
this should print out which element is wrong in the message you're trying to send and help you debug.
think someone just missed this in dev :)
Comment #3
WebSinPat commentedThanks @digitisation. I assumed @title was just the title of the failed email, so wasn't worried that it wasnt printing out, but it is actually debug information.
So now the error message I get is:
Could not send message using Email to user ID 8.
Though i think we already knew it was a problem with sending messages "using Email" so i'm not sure that is terribly helpful.
Comment #4
WebSinPat commentedOK, one more piece of debug info:
When i create a post, there are actually 2 emails that are sent. When I get the error message but still receive the email, it is because I am receiving 1 of the 2 emails but not the other. When I do not get the error message, I receive both emails.
This is the email I always receive, whether or not I get the error message:
Below is the email i DO NOT receive when i get the error message:
Which at least means the error message is accurate, that an email is not being sent when it should be. No idea why the message sometimes fails though.
Comment #5
WebSinPat commentedAfter further debugging:
The problem of the email notification not sending and receiving the error message in the log file "Could not send message using Email to user ID" happens for me iff the email attempting to be sent has a subject line that is longer than 46 characters. 46 sends fine, if the subject line is 47 or more characters it fails, no email is sent, and error messages to the log file.
I'm now running message_notify 7.x-2.5+0-dev as part of commons 3.3
Comment #6
amitaibu> But anything message_notify fails based on length of subject line.
Does it happen also on a clean installation?
Comment #7
WebSinPat commented@Amitaibu, I have no idea. I don't know how to do that.
I think the likeliest thing is that it's a config/conflict or something rather than an absolute failure with message_notify code, but I'm not sure how to continue debugging or how to fix. Any suggestions on this would be appreciated.
current workaround is to make subject lines a fixed length <46 and not include the node title or other variable token-based info in the subject.
Comment #8
dangermonkey commentedMay I ask, where are you editing the subject lines for a fixed length? I can't seem to figure it out.
Comment #9
WebSinPat commented@dangermonkey:
Are you also having problems with having emails sent?
In order to edit your subject lines (or other info/text in the emails) go to
admin/structure/messages
Then you can edit the messages that are sent by email (which in Commons3.3 I think are the following). I made them fixed-length by removing the token and only including fixed text.
Comment #10
dangermonkey commentedThat works perfectly! Thank you so much!
And yes, same issue with the emails!
Comment #11
WebSinPat commentedI've received a question from another person who gets the same problem, with a request for more clarification on how to change the subject length, so here are further instructions.
- go to admin/structure/messages
- select which message you want to modify. For this example I'll do commons_notify_comment_created
- so you can click the "edit" link next to the particular message, or for this example I wind up at:
admin/structure/messages/manage/commons_notify_comment_created- then you can edit the
View modes: Notify - Email subject- I changed my subject to be
New Comment posted on [site:name](it still uses a token, but the token is a fixed length and not very long)
- the ORIGINAL subject was:
New comment on [message:field-target-nodes:0:title] in [message:field-target-nodes:0:og-group-ref:0:title]: [message:field-target-nodes:0:title]which included the comment title, what group it was in, etc etc which made the length unpredictable and over 46 characters.- Make changes for all the messages that get sent via email, which I listed in comment #9, for Commons.
Here is a screenshot of the message management page:

Hope this helps.
Comment #12
arellani commentedI did exactly what you suggested but the error is still the same.
It is necessary to change something else in "Manage field" in the message type or maybe at "OG new content notification (With Message)" on Rules? I did exactly what you sugested but the error still continue.
It is necesary to change something else at Rules?
Comment #13
arellani commentedWebSinPat thank you for all your support!
It is necesary to change what you sugested before and in message-body (type of message) has to be with some value (not empty)
The problem was that the "message-body" was empty :s
Comment #14
bjlewis2 commentedI'm getting this error on a basic site only using Message 7.x-1.9 & Notify 7.x-2.x-dev (not Commons).
I get two errors when trying to send an email:
1. Mail Error - Error sending e-mail (from user@example.com to admin). (I removed my actual email address)
2. Message Notify Error - Could not send message using @title to user ID 1.
These are supposed to be sent when a comment is posted. The comment does get posted, and the message is created successfully (I can view it at admin/content/message). But no email...
Comment #15
WebSinPat commentedEDIT: Actually I can confirm this is happening on a clean Commons 3.5 installation.
DC 3.5
Message 7.x-1.9
Message Notify 7.x-2.5
Message Subscribe 7.x-1.0-rc1
Message Subscribe Email 7.x-1.0-rc1
@bjlewis2, sounds like your setup might be the likeliest to be able to have the maintainers reproduce so we can get this debugged.
Can you reproduce on a clean install? and/or how much customization and contrib modules have you added?
Comment #16
WebSinPat commentedComment #17
bjlewis2 commentedYes, this was a clean install from yesterday. I'll write up some exact steps to reproduce in just a bit. Here are all of the modules I have installed and enabled:
Administration:
Admin Menu (7.x-3.0-rc4)
Admin Menu Toolbar Style (7.x-3.0-rc4)
Hide the Toolbar (toolbar_admin_menu) (7.x-1.0)
Module filter (7.x-2.0-alpha2)
Chaos tool suite:
Chaos tools (7.x-1.3)
Development:
Devel generate (7.x-1.3)
Devel (7.x-1.3)
Fields:
Entity Reference (7.x-1.1)
Message:
Message notify (7.x-2.5+1-dev)
Message notify UI (7.x-1.4)
Message (7.x-1.9)
Message UI (7.x-1.4)
Other:
Entity API (7.x-1.2)
Entity Tokens (7.x-1.2)
Token (7.x-1.5)
Rules:
Rules (7.x-2.6)
Rules UI (7.x-2.6)
Views:
Views (7.x-3.7)
Views UI (7.x-3.7)
Comment #18
ezra-g commentedLet's fix this problem in Commons 3.9.
Comment #19
ezra-g commentedMoving into the Commons queue for triage until we confirm this is a Message Subscribe/Notify issue.
Comment #20
ezra-g commentedComment #21
ezra-g commentedThe only way I'm able to reproduce the symptom in this issue is when testing with the demo users that ship with Commons, and this is expected behavior. The demo users all have @example.com email addresses, and in commons_misc.module, we do:
This will cause drupal_mail() to return a $message['return'] value that is NULL, which in turn causes postSend() to interpret the message sending as a failure. In my dblog, I'm seeing the errors from message_notify, but no Core, "Error sending e-mail" messages.
It does appear that the Message Notify error message has an incorrect token for the text in its error message, " t('Could not send message using @label" should be " t('Could not send message using @title" in order to match the replacement values we pass to t(). However, that's not part of the symptom here.
Regardless of whether we have a bug here, I think it's reasonable to shorten the subjects for our email notifications in some cases.
Marking as "needs more info" for the error that's the subject of the issue (No email notification if subject exceed 46 characters). It would be great if someone could post steps or scenarios to reproduce outside of users with @example.com email addresses so that we can investigate further.
Comment #22
WebSinPat commentedThanks for looking into it @ezra-g.
It seems likely that it's a server config issue...since it happens reliably for some of us and not at all for others.
In another issue @lightsurge suggested this might be the likely culprit: #300387: drupal_mail_send with long UTF-8 subject puts \n to subject line, the mail() function won't send it then.
I have not yet had a chance to try any of those suggestions in that issue... it's all a bit beyond my scope.
I'm not sure how pervasive this is amongst the general commons userbase? Or if there's a commons-based workaround for it.
Also, I kind of wound up opening two issues on this topic before I realized they were the same cause. this issue and also #1993196: Email notifications are not sent when subject exceeds 46 characters. Don't know if we should close one or the other as a dupe, or close both as a dupe of the known UTF issue?
Comment #23
ezra-g commentedI admit that I didn't realize I was participating across two separate issues here.Marking as a duplicate of #1993196: Email notifications are not sent when subject exceeds 46 characters.