vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - Cron Based E-Mail Sending (https://vborg.vbsupport.ru/showthread.php?t=167274)

Paul M 01-07-2008 10:00 PM

Cron Based E-Mail Sending
 
This modification is no longer available or supported.

In default vBulletin if you send a large number of e-mails, vbulletin either puts them in it's queue and then attempts to send them as each user visits a page, or just simply tries to send them straight away (This is the case when you use the Administrators email users inteface).

As a result of this your server can become seriously overloaded very quickly - so sending several thousand e-mails (like a newsletter) can become very difficult (hours spent clicking 'next' in the ACP) - as a result of these problems, this very simple modification was born.

This modification does two things ;

1. E-mails from the ACP inteface are sent to the mail queue, not straight to the mail system.

2. The processing of the mail queue is set-up as a vb cron item.

Obviously for this to work, you must turn on e-mail queuing in the ACP options - set 'Use Mailqueue System' to 'Yes', and 'Number of Emails to Send Per Batch' to a realistic value (based on the cron setting, as below).

There are two realisitc options for the cron job, you can either set it to run every minute, and set the items to be processed to something small (like 10), or you can do what this modification does by default and set it to run every 10 minutes, and set the items to be processed to something larger (like 100).

Remember, 10 per minute = 600 per hour, 100 per 10 minutes is also 600 per hour. The numbers really depend on how quick you want large queues processed, and how much your mail server can handle in one go.

Once working, when using the ACP mail users inteface, remember you can set it to process 9999 at once (not 500 or whatever) as the mails will now go into the queue, not be sent directly.

Note: This modification will affect any queued e-mails such as subscription e-mails. It will not affect registration e-mails as they bypass queuing anyway.

This modification includes the code by Antivirus that displays the current size of the mail queue (v3.7.002 onwards).

Version 3.7.003 has the option to add a small delay before each e-mail is sent (between 1 and 9 seconds). Use this option carefully.



History:

v3.7.001 : First Release for vB 3.7
v3.7.002 : Added mail queue size display code.
v3.7.003 : Added option for a delay between the sending of each e-mail.


joopss 01-08-2008 07:08 PM

Tenks Paul M......... :)

Howell 01-08-2008 08:56 PM

Excellent! Thanks Paul.

I had to change the compatability of antivirus's little addon to get to install but it's working fine after that. ;)

yahoooh 01-09-2008 01:59 PM

thanks

obmob 01-11-2008 03:23 AM

This can be a huge addon, thanks will test it! :3

rainyleaves 01-13-2008 12:15 PM

Thanks Paul. :)

teenhut 01-23-2008 06:42 PM

Thanks a ton. I tried to send email through VB system and my VPS went way damn slow and crashed. I had to abort email sending. I just installed this now. Things will be much easier now :)

yawsh 02-03-2008 03:06 AM

I think this should go as vBulletin built-in as it adds a huge value. Thanks pals.

Paul M 02-03-2008 10:57 AM

You should probably suggest that on vb.com. They're not likely to see any comments over here. :)

hdrmut 02-03-2008 04:47 PM

Very important modification ..
isntalled Done

- this is modification send 1 E-mail in evry 10 but i want chang this numper to send 100 E-mail in evry 10 minutes .. so how i can change ?

Paul M 02-03-2008 06:18 PM

Read the first post.

hdrmut 02-03-2008 09:03 PM

Thank you :)

asj 02-04-2008 12:02 AM

Thank you very much

kylek 02-10-2008 08:30 PM

"Queue Size
Antivirus has posted a nifty little addon that displays the current size of the mail queue here."

This doesn't seem to work with 3.7.0 Beta 4. When you import the product you get this:

The following dependencies were not met:
  1. The product paulm_20060709 must be installed before this product may be installed. (Compatible starting with 1)

Howell 02-10-2008 09:04 PM

Quote:

Originally Posted by kylek (Post 1440355)
"Queue Size
Antivirus has posted a nifty little addon that displays the current size of the mail queue here."

This doesn't seem to work with 3.7.0 Beta 4. When you import the product you get this:

The following dependencies were not met:
  1. The product paulm_20060709 must be installed before this product may be installed. (Compatible starting with 1)

Open: product-anti_mailqueue_stats_acp

Find:
PHP Code:

    <dependencies>
        <
dependency dependencytype="product" parentproductid="paulm_20060709" minversion="1" maxversion="" />
    </
dependencies

Replace with:
PHP Code:

    <dependencies>
        <
dependency dependencytype="product" parentproductid="paulm_cmq_37" minversion="1" maxversion="" />
    </
dependencies

Thats what I did to get it working. :)

Paul M 02-11-2008 11:22 AM

Yes, well spotted.

I suppose what I should really do is ask Antivirus if I can include his code in the main product.

webgeek247 04-19-2008 12:09 AM

Hi Paul, looks like it will do the job once i figure out how to use it properly

Ive setup the script but i got this error

Quote:

Database error in vBulletin 3.7.0 Release Candidate 3:

Invalid SQL:

UPDATE datastore SET
data = data - 250,
data = IF(data < 0, 0, data)
WHERE title = 'mailqueue';

MySQL Error : MySQL server has gone away
Error Number : 2006
Date : Friday, April 18th 2008 @ 07:02:17 PM
Script : http://www.djpassion.co.uk/forums/ad...cron&cronid=21
Referrer : http://www.djpassion.co.uk/forums/admincp/index.php
IP Address : **********
Username : Chris Powell
Classname : vB_Database
MySQL Version :
It seemed to work out with the email send out setting set to 10 but when i tried 250 i got the above error

My host allow 500 emails to be sent out per hour. I have just under 1000 members so to be on the safe side would have thought setting it to send 250 emails per hour would work ok...please help

webgeek247 04-19-2008 12:11 AM

Ps even though it said it failed i think the emails still sent out because the Mailqueue Quick Stats went from around 950 to this

Quote:

There are currently 679 unsent emails remaining in the mail queue.

webgeek247 04-19-2008 07:44 AM

just checked back this morning and have now got
Quote:

There are currently 434 unsent emails remaining in the mail queue.
more info. the error message i got above was what i got after running the Run Now button in scheduled tasks. hope this extra info helps.

Paul M 04-19-2008 11:08 AM

You obviously have a fairly low mysql timeout, so if you try and send too many emails in one go, your database connection is timing out before they have all been sent.

webgeek247 04-19-2008 02:15 PM

Well I sent 167 on one of my other sites which is hosted on the djpassion account as a addon domain and they all sent successfully so I don’t think its a mysql problem. I did change the schedule times around a little invbulletin which I think fixed it though. It didn’t seem to work when set to send all emails everyday. But once I figured out how to change it to 1 hour I think it sorted it. I also took the limit down from 250 to 100 and they all seem to be sending ok. Like when I check back every hour 100 more have sent so I guess its working ok now...? If so thanks to you so much for this hack and to Antivirus for his little addition….makes life much easier.

cheers chris

F.nk 05-05-2008 09:57 PM

Thank you, it works beautifully :D
I also see that my server is faster ^_^
thanks.

TCB 05-06-2008 04:10 PM

Thanks for this product. I have some questions though:

I have in the ACP under email options:

Email Flood Check: 0
Number of Emails to Send Per Batch: 25

Then the cron is setup to run every 10 minutes.

What does the floodcheck do? Does it interfere with this addon?

Where can I see the number of unsent messages in the cron queue (antivirus addon)?

On the end of your first post you say:
Quote:

Once working, when using the ACP mail users inteface, remember you can set it to process 9999 at once (not 500 or whatever) as the mails will now go into the queue, not be sent directly.
.
I don't understand this part. First we have to set a number in the 'email'-option in the ACP (like 25), and then (when?) it can be safely set to a high number?

Paul M 05-06-2008 04:22 PM

Flood check is not part of this mod.

The ACP mail inteface is when you mass email users via the ACP, not the Emails per batch option, totally different thing.

TCB 05-06-2008 05:50 PM

so this current setting is right? If so, when can this '25' be changed to '9999'?

Paul M 05-06-2008 06:39 PM

It cant, like I said, its nothing to do with that.

Its the ACP > Users > Send Email to Users.

wii 05-07-2008 01:55 PM

My host has this limit:

Run cron entries with intervals of less than 15 minutes

1. Would that be a problem ? Since I´m allowed to send 500 mails an hour

2. Mailqueue Quick Stats should be the total number of mails, right ?

3. How do I set the time interval - how many mails to send out a minute ?

4. Can I delete a Mailqueue once it started ?

Thanks

Jase2 05-20-2008 02:42 PM

Thanks Paul! Will come handy when I start sending a newsletter, but works great for subscriptions in the mean time. :)

coberr 05-29-2008 09:26 PM

Hello,
I installed the plugin.
I turn on e-mail queuing in the ACP options - set 'Use Mailqueue System' to 'Yes', and 'Number of Emails set to 10.

How to send now mails to all normal users.
Thank you.
Regards,
Manuel

Paul M 05-29-2008 09:50 PM

ACP > Users > Send Email to Users.

losedude 05-31-2008 05:46 PM

Hi,

I'm using this mod right now and I must admit it's a life saver ^^ , I wouldn't be able to send out emails without it.

I was wondering though, where do I have to go to see the amount of emails that are left to be sent ?

Thanks

Paul M 06-01-2008 05:13 PM

Thats entirely server/os/control panel dependant (unless you means still to be sent by vb ?).

losedude 06-03-2008 04:59 PM

Yes that's what I mean, how many emails VB has left to send.

Paul M 06-03-2008 05:01 PM

Its displayed in the ACP.

360themes 06-05-2008 02:57 AM

i want to send HTML Mail to Members by this way ... but VBB seems not support T.T ... who can help me ?

alhindasi 06-23-2008 02:47 PM

Quote:

The number of seconds delay before sending each e-mail. Note that values greater than 9 seconds will be ignored
can you tell me what is the number it can be good to my sarver not mack up load

Paul M 06-23-2008 04:51 PM

Unless you have a specific reason then you wont normally need to change it from zero.

alhindasi 06-23-2008 05:22 PM

Quote:

Originally Posted by Paul M (Post 1556971)
Unless you have a specific reason then you wont normally need to change it from zero.

that mean the zero is good ...

alhindasi 06-23-2008 05:31 PM

Dear in My Web Host Manager i do like this :
Number of minutes between mail server queue runs (default is 60). : 10
The maximum each domain can send out per hour (0 is unlimited) : 3500

in my Server Only One site only
----------------------------------------------------------------------------------
in the forum Option i do in : Number of Emails to Send Per Batch: 500


can you tell me what is the good for me i have 50,000 Members

Sherrie 06-27-2008 01:13 AM

Okay I am new to adding plugins and products so this may be a really dumb question so apologies in advance :)

I have installed this as instructed and already have email queue enabled but where I am stuck is the next step as I do not follow where I change the cron settings:

Quote:

Obviously for this to work, you must turn on e-mail queuing in the ACP options - set 'Use Mailqueue System' to 'Yes', and 'Number of Emails to Send Per Batch' to a realistic value (based on the cron setting, as below).

There are two realisitc options for the cron job, you can either set it to run every minute, and set the items to be processed to something small (like 10), or you can do what this modification does by default and set it to run every 10 minutes, and set the items to be processed to something larger (like 100).
Any help would be appreciated

Thanks


All times are GMT. The time now is 07:13 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01451 seconds
  • Memory Usage 1,830KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_php_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete