I'm using the u create module together with Organic Groups on Drupal 6. I want to send an email message to invite users to join the group. I am using a hosting service to test my application.

When I send an invitation through the u create form, first I receive the following message:

# You are now a member of the History Group.
# You have created an account for test2, password and login instructions have been sent to the e-mail address test2@itwrite.com.

And then I receive the following error message in through the form:

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

And the following error appears in the Watchdog window:

Error sending e-mail (from xyz@netvision.net.il to [Funny Ideas] We have created an account for you).

It appears that the correct "from" email address is used, but the wrong "to" email address is used, and it is picking up what I defined as the site name instead. (Obviously that is incorrect, since it should be mailing the mail message to the organic group invitee.)

It appears to me that sendmail is configured correctly on my hosting service. Registering new users to the site is successfully achieved as well.

Could it be a configuration problem or a problem of something that I've missed? Should I be using SMTP or some other module instead?

Thanks for any help,
Momo

Comments

alex_b’s picture

If your site can mail, ucreate should be able to mail as well. There is no particular module ucreate expects to be installed for mailing.

momo18’s picture

As I mentioned earlier, I am using Organic Groups with Organic Groups User Roles and U create in Drupal 6. Can anybody please advise the minimum permissions I have to set in order to invite subscribers to one of my Organic Groups? That would be very helpful. I still can't get the U create module to send emails. I couldn't find this information anywhere in the documentation. I have even tried sending emails as admin.

I also have a suggestion. I received the following error message(s) when mail could not be sent from user/add:

========================

* You are now a member of the XYZ Group.
* You have created an account for user1 example, password and login instructions have been sent to the e-mail address user1@example.com.

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

===========================

Upon checking it is evident that the system created a user1, and the user was added to the database however the email inviting the subscriber to subscribe was not mailed. Maybe it should be that if no email was mailed to the group invitee then no account should be setup for the subscriber either. That I should think would be the correct order.

momo18’s picture

I am still on the same problem and trying to use U create together with Organic Groups. I created a few groups and I want a subscriber to invite a new user. I tried giving a subscriber all possible permissions but none of that has helped so far.

At first I found a message in the log file saying the following:

Error sending e-mail (from iom@example.net.il to [Self Organizing] We have created an account for you).

The "Self Organizing" part is the site name I gave the website and so I figured something must be fishy, and it's picking up the wrong field entirely.

Since that seemed strange to me, I changed the Administer > Site Information > Name field value from Self Organizing to the name of the user I wanted to mail the invitation to and sure enough I received a different error message in the recent log entries file, which now is as follows:

Error sending e-mail (from iom@example.net.il to [test5@webmadman.com] We have created an account for you).

Since I don't know how to use a debugger with PHP I can't debug this problem entirely, but it seems I've somewhat narrowed down the issue and may'be someone else can help towards resolving it because I'm still stuck with it.

momo18’s picture

OK, I think I've narrowed it down somewhat. There was indeed a problem with the module, which generated the error. The drupal_mail signature has changed from Drupal 5 to Drupal 6. That was what was causing the error message I received earlier. The position of the $to variable has changed from second to third position.

Drupal 5:
drupal_mail($mailkey, $to, $subject, $body, $from = NULL, $headers = array())

Drupal 6 – 7:
drupal_mail($module, $key, $to, $language, $params = array(), $from = NULL, $send = TRUE)

So I changed line 288 in the ucreate.module file to read the following:

if (!drupal_mail('ucreate', 'create', $edit['mail'], $subject, $body)) {

And, the error I was receiving went away.

Anyway, I still haven't received back the test mail I sent, so apparently the problem still exists. I am not a PHP buff or have such a good understanding of Drupal code, so if anyone can fix this problem or advise what to do I would sincerely appreciate it.

alex_b’s picture

I can't commit the time to research this issue at the moment. If you'd like to get this fixed, please submit a patch.

momo18’s picture

I hope somebody can help me fix this, because my PHP and/or knowledge of Drupal programming internals is not near good enough for the job.

Anyway, it's a lovely module if it works.

momo18’s picture

Status: Active » Fixed

I tested the latest u create 6.x-1.0-beta2 version - and the upgraded changes indeed resolved the problem I discussed in this thread. Thanks for the wonderful work to all.

Moses - Technical Writer
Thanks again!

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.