MyBB Community Forums

Full Version: Mass Mail Trouble
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm having trouble sending out mass mailings, when I try to make it run I get this error

Quote:MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
2006 - MySQL server has gone away
Query:
UPDATE mybb_massemails SET sentcount='50' WHERE mid='3' LIMIT 1

Anyone know how to fix? I'm on version 1.4.5 right now
Contact your host. Something is wrong with their SQL server.
And, please, update to 1.4.8, you're vulnerable to exploits.
My host said that the SQL server will only allow 18 connctions at a time then times out. But I don't think the mass mailing makes more than 18 connections does it?
Well you may have more connections form general visitors to your forum, 18 is a crazy low limit, do you know why it's so low??
I'm not sure why the limit is like that, but they're asking me what are the last changes made in my database before the error. What am I supposed to tell them that I ran the script? Where is the script located in the folders so I can point them for something to look at?
It's ./inc/tasks/massmail.php, but I don't think it's anything to do with the mail script itself, them knowing where the file is won't really help the situation... 18 connections is too low, I'd ask them to increase it.
I asked but they said that it has to be limited at that for other users on the server. Umm I don't know if this has to deal with this but when I did a mass PM instead of email it worked just fine, do you know why that would be because that uses the same script doesn't it?

Could it possibly be that for some reason it's looping and opening a new connection or something because it does send to at least one person (and only that one person it actually sent it to anyone in the first 50 userid's which met the group parameter)?
I decided to write a little script to try it. It can get through about 180 users before timing out
<?php
$host2 = "HOST";
$user2 = "USER";
$password2 = "PASS";
$db2 = "DATABASE";

$con2 = mysql_connect($host2,$user2,$password2);
if (!$con2)
  {
   die('Could not connect: ' . mysql_error());
  }

mysql_select_db($db2, $con2);

$submit = mysql_query("SELECT * FROM mybb_users WHERE usergroup=2");
while ($request = mysql_fetch_array($submit)){

$to = $request['email'];
$subject = 'July Newsletter';
$message = 'email ';

$header = 'From: email' . "\r\n" . 'Reply-To: email';

mail($to, $subject, $message, $header);
 }
 
 mysql_close($con2);
 ?>

This works better than your mass-mailing but it's horribly inconvenient for me to mail this way. I'm still talking with my host but they are super unhelpful.

Is there anyway I could integrate that into the mass mail feature so I can still run it through ACP? I'm still confused why PM mass mail works yet email doesnt.
Another thing that I noticed, I can do one to admins as a test just fine, then again there are only 2 admins, but the other mails go to 100 or 1000+ users

Would changing the limit per page down possibly work?