Hi.
Brand new install with no other modules.
Drupal 6.15
Dev version of Reg Code

It seems like somehow the form for registrations is somehow "losing" the e-mail address despite it having been entered by the user. The e-mail entered in both tests was "kristina@qwo.kristinahall.ca". This e-mail sends and receives e-mail without any problems as does the site e-mail.

I would appreciate some thoughts on how to resolve this problem as it seems this particular issue is not being responded to.

This occurs when an administrator tries to create an account for a user when notify user is checked off.

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

No e-mail is sent to the administrator.

If an anonymous user created an account you get:

Unable to send e-mail. Please contact the site administrator if the problem persists.
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your e-mail address.

The admin account receives this via e-mail:

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

While the user receives nothing.

Here's a copy of the errors in the log:

Type mail
Date Thursday, December 17, 2009 - 23:23
User Anonymous
Location http://qwodev.kristinahall.ca/user/register
Referrer http://qwodev.kristinahall.ca/user/register
Message Error sending e-mail (from info@qwodev.kristinahall.ca to ).
Severity error
Hostname 216.246.226.172
Operations

Type mail
Date Thursday, December 17, 2009 - 23:20
User Admin
Location http://qwodev.kristinahall.ca/admin/user/user/create
Referrer http://qwodev.kristinahall.ca/admin/user/user/create
Message Error sending e-mail (from info@qwodev.kristinahall.ca to ).
Severity error
Hostname 216.246.226.172
Operations

This is a problem that has been going on since end of October with the development release.

Comments

jaypan’s picture

You are best off opening an issue for this in the issue queue for that module. The module maintainer is unlikely to see it here.

Contact me to contract me for D7 -> D10/11 migrations.

Kristina-2’s picture

There was one opened for this same issue in the end of October. I "added" to the issue on November 8th. It's gone ignored since then.

I figured I would try other methods to get help with this as I need this problem resolved before I can move ahead with my project.

jaypan’s picture

Fair enough! This is definitely your second best option.

Contact me to contract me for D7 -> D10/11 migrations.

Elteto’s picture

Just quick checks, see if a little detail pops up that would explain it.

1. Is the e-mail address filled in under Site information?
2. Under modules, is Simple Mail enabled?
3. Do you have SMTP Authentication Support?
4. Do you have a default mail sending method selected under Messaging & Notifications?
5. If you have SMTP Authentication, (under Site configuration>>SMTP Authentication Support) in its "E-mail from name option", is it filled in? It says it should automatically use the site's information if you leave it blank, but due to some bug, I noticed it does not, and gives me the same error message you get.

Kristina-2’s picture

1. Yes the e-mail field at http://qwodev.kristinahall.ca/admin/settings/site-information is correct, and filled in.
2. I don't have simple mail installed. This is a clean install with just the Registration Code module.

Are 3, 4 and 5 related to the e-mail server itself, or the drupal install?

For now, I'm guessing you mean the Drupal install. :)
3. SMTP Authentication Support if this is a module no. I know the e-mail used has both SSL and regular options based on which mail servers I set.
4. Messaging & Notifications does not seem to be an option in Administration in Drupal 6.15
5. Site configuration>>SMTP Authentication Support -- don't see this option in Drupal 6.15.

I know that without the Registration Code module the sign up, and admin create user work normally -- they send e-mails to the user without any problems.

Elteto’s picture

Messaging and Notifications can be enabled under Modules. Simpe Mail is under the Messaging section of Modules as well.

In order for your site to send messages and e-mail, it needs to have some sort of mailing protocol enabled. I had the same problem with sending messages you did. I installed SMTP Authentication Support, and now everything works fine. Basically you just enter e-mail account settings in that module the same way you would for your e-mail software (Outlook, Thuderbird, etc...)

Does Registration Code give you options to select mail sending methods? Or does it automatically use the site's default one? In that case, I would really give SMTP a shot...

Kristina-2’s picture

Though I have never needed these modules in the past for the site to send e-mails with Drupal 6.14, and 6.15 using the e-mails hosted by the same server.

Also, the site sends e-mails fine when I disable the Reg Code module. So needing to add a module to make messaging that the module breaks doesn't make sense. From what I understand, it should be using the default mailing settings.

I'll try to SMTP to inform the module maintainer that maybe his module is breaking basic registration functionality and the only way to temporarily bypass the problem is to install the SMTP module.

Kristina-2’s picture

Tried the SMTP module with the Registration code module.

I get "Invalid address: You must provide at least one recipient email address."

So clearly there's a problem with the Registration code module losing the e-mail address of the user (aka "to field")somehow.

luf’s picture

Tried the SMTP module with the Registration code module.

I get "Invalid address: You must provide at least one recipient email address."

So clearly there's a problem with the Registration code module losing the e-mail address of the user (aka "to field")somehow.

I know this is quite an old issue, however there is a workaround for SMTP errors like: "Invalid address: You must provide at least one recipient email address."
If your SMTP server is set up correctly, even though phpmailer spits out this error, emails should still send and route properly.
If you are able to send emails but still receive this message your best bet is to:
1. Open your modules/smtp/phpmailer folder
2. Find the: 'class.phpmailer.php' file
3. Run a Find for: " You must provide at least one recipient email address. " and " Invalid address " should be a few lines below it.
4. Remove the error messages so they read:
'provide_address' => ' ',
'invalid_address' => ' ',
Why PHPmailer has become inconvenient for Drupal to send messages, I dont know, would be nice to figure out.
These errors came about from Ubercart checkouts where user signup is required as purchase is completed.
I have attempted to use older versions of PHPmailer first and that did not work, same message applied - however emails we're sending and routing properly thanks to SMTP Authentication module.

Kristina-2’s picture

Additional Information copy/pasted from the issue:

1. Is the e-mail address filled in under Site information?
- Yes the e-mail field at http://qwodev.kristinahall.ca/admin/settings/site-information is correct, and filled in.
2. Under modules, is Simple Mail enabled?
- I don't have simple mail installed. This is a clean install with just the Registration Code module.
3. Do you have SMTP Authentication Support?
- I do not have this module installed.
4. Do you have a default mail sending method selected under Messaging & Notifications?
- Messaging & Notifications does not seem to be an option in Administration in Drupal 6.15
5. If you have SMTP Authentication, (under Site configuration>>SMTP Authentication Support) in its "E-mail from name option", is it filled in? It says it should automatically use the site's information if you leave it blank, but due to some bug, I noticed it does not, and gives me the same error message you get.
- Site configuration>>SMTP Authentication Support -- don't see this option in Drupal 6.15.

Someone recommended I try the SMTP Authentication Support module to temporarily fix this problem. 7
SMTP Authentication Support v 6.x-1.0-beta4.

Ran a test and got:
"Invalid address: You must provide at least one recipient email address."

With SMTP Installed, and without Reg Code installed the system sends welcome e-mails without problems.
Without SMTP Installed, and without Reg Code installed the system sends welcome e-mails without problems.
With having SMTP installed or not installed and Reg Code installed the users e-mail address (the 'to' field of the e-mail) gets lost.

Kristina-2’s picture

Spent a long time tonight troubleshooting this problem with nadavoid on IRC. We looked specifically at function regcode_user.

The best I get it to is sending a proper user e-mail (hoorah), and an admin e-mail which still fails to display a user name or proper url.

Below is all the tests I went through in hopes it will help someone resolve this problem.

Test 1:

Commented out case register in switch $op.
Found it removed the registration code field on the registration form.
This makes sense.

Test 2:

Case register is uncommented.
Case validate is commented.
Get error and success message.

Unable to send e-mail. Please contact the site administrator if the problem persists.
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your e-mail address.

Admin e-mail sends with no user name.

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

No user message is sent.

Test 3:

Case register is uncommented.
Case validate is uncommented.
Case insert is commented.
Receive success message.

Your password and further instructions have been sent to your e-mail address.

User message sent.

Test3,

Thank you for registering at Queer Women Ottawa DEV. You may now log in to http://qwodev.kristinahall.ca/user using the following username and password:

username: Test3
password: m8CbiyxVQb

You may also log in by clicking on this link or copying and pasting it in your browser:

http://qwodev.kristinahall.ca/user/reset/18/1261204110/0f0c28cb152673534...

This is a one-time login, so it can be used only once.

After logging in, you will be redirected to http://qwodev.kristinahall.ca/user/18/edit so you can change your password.

-- Queer Women Ottawa DEV team

No admin message is sent.

Test 4:

Case register is uncommented.
Case validate is commented.
Case insert is commented.
Receive success message.

Your password and further instructions have been sent to your e-mail address.

User message sent.

Test4,

Thank you for registering at Queer Women Ottawa DEV. You may now log in to http://qwodev.kristinahall.ca/user using the following username and password:

username: Test4
password: z5MZ5CBWTY

You may also log in by clicking on this link or copying and pasting it in your browser:

http://qwodev.kristinahall.ca/user/reset/19/1261204325/c81463bda89182112...

This is a one-time login, so it can be used only once.

After logging in, you will be redirected to http://qwodev.kristinahall.ca/user/19/edit so you can change your password.

-- Queer Women Ottawa DEV team

No admin message.

Test5:

Change current case register to:

case 'register':
$form['regcode_code'] = array(
 '#type'        => 'textfield',
'#title'       => variable_get('regcode_field_title', 'Registration Code'),
'#description' => variable_get('regcode_field_description', 'Please enter your registration code.'),
'#required'    => !$code_optional,
);
return $form;
break;

Case register is uncommented.
Case validate is commented.
Case insert is commented.
Received success message.

Your password and further instructions have been sent to your e-mail address.

User message sent.

Test5,

Thank you for registering at Queer Women Ottawa DEV. You may now log in to http://qwodev.kristinahall.ca/user using the following username and password:

username: Test5
password: 5dpGbstkUj

You may also log in by clicking on this link or copying and pasting it in your browser:

http://qwodev.kristinahall.ca/user/reset/20/1261204551/c246360c90cceb28f...

This is a one-time login, so it can be used only once.

After logging in, you will be redirected to http://qwodev.kristinahall.ca/user/20/edit so you can change your password.

-- Queer Women Ottawa DEV team

No admin message is sent.

Test6

Case register is uncommented, and keeps new code from test5.
Case validate is commented.
Case insert is uncommented.
Gives error and success message.

Unable to send e-mail. Please contact the site administrator if the problem persists.
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your e-mail address.

Admin e-mail is sent with no user name.

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

User e-mail was not sent.

Test7

Case register is uncommented, and keeps new code from test5.
Case validate is uncommented.
Case insert is commented.
Success message.
User message sent.
Admin message not sent.

Kristina-2’s picture

I got an e-mail from aidanlis, the maintainer for the regcode module. He pointed me to the function in the module for regcode_mail and the key he have used is not unique and should be renamed. I ran a search for this but was not able to find such a function.

I did find function regcode_mailer_mail($key, &$message, $params) in regcode_mailer.module

$key is used only in regcode_mailer files.
regcode_mailer\regcode_mailer.module(111): foreach ($code as $key => $token) {
regcode_mailer\regcode_mailer.module(112): $tokens['@' . $key] = $token;
regcode_mailer\regcode_mailer.module(165): function regcode_mailer_mail($key, &$message, $params) {
regcode_mailer\regcode_mailer.module(166): switch($key) {

Will rename $key in that function to mailkey to see what happens when run without anything commented out in regcode.module.
Got error and success message.

Unable to send e-mail. Please contact the site administrator if the problem persists.
Thank you for applying for an account. Your account is currently pending approval by the site administrator.
In the meantime, a welcome message with further instructions has been sent to your e-mail address.

Received admin mail

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

User mail failed to send.

Will try renaming the $key to $mailkey and see what happens.
Admin mail is:

has applied for an account.

http://qwodev.kristinahall.ca/user/0/edit

User mail failed to send. :/

All I can guess is maybe some values are not being passed along in order to fulfill what hook_mail needs or something.
http://api.drupal.org/api/function/hook_mail/6