MyBB Community Forums

Full Version: Error when mass-mailing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
When I try to mass-mail I get this error. (see attached pic)

Any idea why and how to fix it? Undecided

MyBB Version: 1.4.13
PHP Version: 5.2.6
SQL Engine MySQL: 5.0.37
Try re-uploading a fresh copy of:

/admin/inc/class_form.php
/admin/modules/user/mass_mail.php
/admin/index.php

Also, are you running the latest version?
I run the latest version.

I tried to reupload the files but I get the same error. Sad

Can I upload all files without running upgrade.php? upgrade.php is just for the database, right?


Edit: I uploaded all the files except settings.php and I still get the same error. What should I do, please help! I need to send these mails today! Sad
Does anyone know in what file MyBB saves the database info?
Does your host have PHP mail enabled?
Nevermind, found the config.php.
Bob, PHP mail seem to work because it can send out signup-mails.

Also, when massmailing it did send out one email to the admin only.
aaaaaaaaaaaaaaaaaaaaaaaaaahhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh!
Should my database have both these fields? "memberName" and "member_name"?
Can you watch the swearing in future please?? Thanks.

What table are these fields in or where are you expecting them to be?? Neither look like MyBB field names.

Go to ACP > Users & Groups > Groups > are all your usergroups there??
Yes, sorry.

Today I installed MyBB on another domain and I get the same error but this time when trying to create a new user from the admin-panel.

The usergroups look just fine on both forums!
Most likely, your host has PHP sendmail disabled.
It's nothing to do with sending the mail, they just happen to be creating a mailing here, it's about generating a select box, specifically containing usergroups.

./admin/modules/user/mass_mail.php:948:

$form->generate_select_box('conditions[usergroup][]', $options, $input['conditions']['usergroup'], array('id' => 'usergroups', 'multiple' => true, 'size' => 5))

Also the errors from this thread... ./admin/modules/user/users.php:532:

$form->generate_select_box('usergroup', $options, $mybb->input['usergroup'], array('id' => 'usergroup'))

./admin/modules/user/users.php:533:

$form->generate_select_box('additionalgroups[]', $options, $mybb->input['additionalgroups'], array('id' => 'additionalgroups', 'multiple' => true, 'size' => 5))

What's it's complaining about in all 3 errors is line 359 of ./admin/inc/class_form.php:

foreach($option_list as $value => $option)

$option_list is the second parameter in the three pieces of code above. The code that generates $options in these three code blocks is as follows:

$query = $db->simple_select("usergroups", "gid, title", "gid != '1'", array('order_by' => 'title'));
while($usergroup = $db->fetch_array($query))
{
	$options[$usergroup['gid']] = $usergroup['title'];
}

If $options is apparently an invalid argument, it's not an array, and the only time it wouldn't be an array is if it didn't loop through the while loop, but it only wouldn't loop through if the query returned no results. The main usergroups list queries the usergroups table too, as opposed to reading fromt he cache, but if that's fine, I can't see why the query is failing in these locations.

Try this... line 943 of ./admin/modules/user/mass_mail.php and line 526 of ./admin/modules/user/users.php:

while($usergroup = $db->fetch_array($query))

change to:

$options = array();
while($usergroup = $db->fetch_array($query))

This will get rid of the error, but is there actually anything in the list of usergroups that's being generated here?? I.e. when making the mail and creating a new user there'll be a select box with usergroups, what's in them after making this change??
Yes, that did get rid of the error.



Now it looks like this, which seem to be correct. (The red border around some fields is just a browser-plugin I use)


So can I use the forum now or is the error still in the background?
Pages: 1 2