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=231715)

Paul M 12-29-2009 10:00 PM

Cron based e-mail sending
 

--------------------------------------------------------------------------------
This modification has been withdrawn.
vBulletin 4.0.x and 4.1.x are no longer supported.

The feature is already built into the core vBulletin 4.2.x code.
--------------------------------------------------------------------------------


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

The result of this can be that your server can gets seriously overloaded very quickly - or on many hosts, you get banned for exceeding their e-mail sending limits. This can make sending several thousand e-mails (like a newsletter) very difficult.

This modification helps in three ways ;

1. The processing of the mail queue is set-up as a vbulletin cron item.

2. You can add a small delay before each e-mail is sent (0,1,2 or 5 seconds).

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

Use option 2 carefully, otherwise you will slow your e-mail system right down.

For this to work, you must use e-mail queuing (ACP Options - Use Mailqueue System = Yes) and also the 'Number of Emails to Send Per Batch' needs to be a realistic value (see below). The installation process will attempt to set these options for you. This modification also requires two file edits to work correctly.

There are two 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 80, which is the default).

Remember, 10 e-mails per minute = 600 per hour while 80 e-mails every 10 minutes is 480 per hour. The numbers you set really depend on how quick you want large queues processed, and how much your mail server can handle in one go. The default settings are fine for most people.

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

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

This modification also displays the size of the e-mail queue in the ACP homepage, based on code supplied by Antivirus.

To install, download and uzip the files, then follow the instructions in the text file.


History:

v4.0.1 : 30-Dec-2009 : Initial release for vb 4.0.0 Gold.

v4.1.0 : 04-Dec-2010 : Updated for vBulletin 4.1.

v4.1.7.0 : 16-Oct-2011 : Updated for vBulletin 4.1.7.


yahooooh 12-30-2009 09:02 PM

thank you

Nadeemjp 12-30-2009 09:31 PM

thanx paul, have had this trouble with my host providers and my limit for one hour is 500 emails. i didnt knnow what to do, but this will help.
thanx

Dr.osamA 12-30-2009 09:58 PM

installed

thanxx
________
Uggs

AliMadkour 12-30-2009 10:34 PM

very useful
thanks : )

ShadowStalker 12-30-2009 11:41 PM

Might want to fix your title

Hornstar 12-31-2009 01:37 AM

yeah I could use some Cron ased e-mail sending :D

Back when I did use this, I noticed it helped with the server load, however since I get around 1000 registrations a day and have almost half a million members it was just delaying the sending of the critical emails too much.

supamodz 12-31-2009 11:15 AM

hey paul i want to use this mod so bad but when i input your code in functions.php i get a syntax error can you please show me how to place the code in the functions.php do i leave out the trailing slashes im confused thank you in advance.

Paul M 12-31-2009 11:18 AM

Quote:

Originally Posted by hornstar1337 (Post 1943055)
yeah I could use some Cron ased e-mail sending :D

Ooops, fixed.

Quote:

Originally Posted by hornstar1337 (Post 1943055)
however since I get around 1000 registrations a day and have almost half a million members it was just delaying the sending of the critical emails too much.

This has no effect on registration e-mails etc as they bypass the queue system in vb anyway.

saqibnpt 12-31-2009 01:00 PM

thanks

AzzidReign 12-31-2009 02:31 PM

Glad this one was updated!

abdobasha2004 12-31-2009 05:10 PM

awesome
I have vb3.7 but expected to fing the suitable version in related mods
and that what happened
thanks a lot

Griffoneur 01-01-2010 12:54 AM

WHY isn't this a part of the vBulletin package? I can't run my site without this mod.
Really appreciate your mod Paul.

nomoreturn 01-01-2010 12:40 PM

Installed and i couldnt find in admin cp
ACP Options - Use Mailqueue System
where its is?

Paul M 01-01-2010 12:53 PM

ACP > Options > Email Options.

Sworm 01-02-2010 05:40 PM

This is the most utility mod in this forum :) All the server not dedicated will not send more of 400 email in 1 hour!

GREAT job Paul M :)

supamodz 01-02-2010 05:52 PM

Hi guys can anybody help me get this mod running im having trouble placing the code in functions.php i keep getting errors and everybody seems to have no problem installing i just want to know what i am doing wrong please.

Paul M 01-02-2010 06:54 PM

Its impossible to help you unless you give some clues, like what errors you get, and what text editor you are using.

supamodz 01-02-2010 08:25 PM

Quote:

Originally Posted by Paul M (Post 1945223)
Its impossible to help you unless you give some clues, like what errors you get, and what text editor you are using.

hi paul im using dreamweaver i am attaching some screenshots to give you some idea of what is going on image 002 is before i input the code 001 is code installed and 003 is after i upload it to my server am i even putting this code in the right place ? thanx.

Paul M 01-03-2010 01:43 AM

You are not editing the correct place.

The instructions say ;

Quote:

exec_mail_queue();
You are editing ;

Quote:

function exec_mail_queue()
Thats why you are failing. :)

supamodz 01-03-2010 02:45 AM

Quote:

Originally Posted by Paul M (Post 1945509)
You are not editing the correct place.

The instructions say ;



You are editing ;



Thats why you are failing. :)

Thanks paul finally installed i had a feeling i was missing something:D

EricPSF 01-09-2010 09:55 PM

Hi Paul,

I'm a little bit confused over the setting, please kindly advice.

My host only allows max 100 emails per hour. So, how do I go about setting it safely?

(1) Is setting "Number of Emails to Send Per Batch" to 100 is correct? Or shall I remain it as 80?

(2) Do I have to set the "E-Mail Send Delay"?

Thank you!

Paul M 01-09-2010 11:15 PM

As the main post says, by default, it runs every 10 mins. So setting the batch size to 100 would send 6 x 100 per hour (600). For 100 per hour divide 100 by 6 (=16). To be safe, set it to 15. Do not set the send delay unless you have a specific reason to do so.

EricPSF 01-18-2010 03:02 AM

Hi Paul,

Pardon me, may I know where is the setting for:

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

Thank you.

Paul M 01-18-2010 10:12 AM

Its part of the page when you e-mail members from the ACP, you do not need to worry about it unless you use that facility, in which case you will clearly see it.

EricPSF 01-18-2010 12:17 PM

Hi Paul,

I have received hundreds of bounced back email with the following error msg:

"This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:
xxxx@gmail.com
Domain mysitename.com has exceeded the max emails per hour (500) allowed. Message discarded."

I was thinking to increase to 9999 for the default 500.

Paul M 01-18-2010 04:29 PM

This is unrelated to the setting you asked about.
Quote:

Domain mysitename.com has exceeded the max emails per hour (500) allowed. Message discarded.
Either you have your batch setting to high, or you havent installed this correctly.

EricPSF 01-19-2010 12:48 AM

Quote:

Originally Posted by Paul M (Post 1959327)
This is unrelated to the setting you asked about.


Either you have your batch setting to high, or you havent installed this correctly.

Hi Paul,

My "Number of Emails to Send Per Batch" is only 15.

Nvm, I will reinstall the mod once again and see how it goes.

Thank you.

cloferba 01-21-2010 12:49 AM

i need to cancel sended emails...because i wrote a gmail address to send mails, and it is blocked has spam....

i´ve disable this cron..and then re enable, but it still sending emails

how can i stop it?

Paul M 01-21-2010 08:39 AM

Delete the e-mails from the mailqueue table.

cloferba 01-21-2010 11:09 AM

all values from mailqueue table?

i only see
mailqueueid
dateline
toemail
fromemail
subject
message
header

EricPSF 01-22-2010 05:42 AM

Hi Paul,

I encountered 1 problem, need yr advice.

I send email (to three of my own accounts) using the ACP; it prompted sent..but I didn't received any of the emails...?

I can see from the ACP front page "The current e-mail queue size is 7" and my Number of Emails to Send Per Batch is only 15.

Paul M 01-22-2010 09:50 AM

What is your question ?

cloferba 01-22-2010 10:29 AM

paul help me...it still sending emails :S

Paul M 01-22-2010 10:57 AM

Help you do what ? Its supposed to send e-mails.

cloferba 01-22-2010 09:31 PM

well..i will tell you

i wanted to send newsletters...so i did it, but using a @gmail.com address. So, it is consider has spam (i have all my gmail account full of mails saying

Quote:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

dbmaster@example.com
SMTP error from remote mail server after MAIL FROM:<xxx@gmail.com>:
host gateway.websitewelcome.com [64.5.52.8]: 553 5.5.4 I was unable to send this e-mail because the domain ( gmail.com ) has been black listed due to spam or forgery.
so, im not going to wait all days until it finish to send emails consider spam, so i want to cancel the sending...

Paul M 01-22-2010 11:12 PM

Then you need to delete the records form the mailqueue table. Im sure I told you this once. :)

EricPSF 01-23-2010 05:54 AM

Quote:

Originally Posted by Paul M (Post 1963233)
What is your question ?

Hi Paul,

My 7 trial emails were delayed sending for abt. 3 hrs. Is it true that this mod needs heavy traffic in order to perform better? Any ways of triggering it to send the emails at a faster speed?

Btw, where can I find the mailqueue table that you have mentioned in yr last post?

cloferba 01-23-2010 01:18 PM

Quote:

Originally Posted by Paul M (Post 1963889)
Then you need to delete the records form the mailqueue table. Im sure I told you this once. :)

ok, but then am i going to have problems to send emails if i delete all from mailqueue table?

or that table is created every time a email is set to be sended?

Paul M 01-23-2010 04:03 PM

Quote:

Originally Posted by EricPSF (Post 1964098)
Hi Paul,

My 7 trial emails were delayed sending for abt. 3 hrs. Is it true that this mod needs heavy traffic in order to perform better? Any ways of triggering it to send the emails at a faster speed?

Btw, where can I find the mailqueue table that you have mentioned in yr last post?

It uses the vbulletin cron system, which does require (proper) visitors to your site to work. If you have little or no traffic at all then its not going to trigger, or take a while.

The mailqueue table is just another table in your vb database.


Quote:

Originally Posted by cloferba (Post 1964329)
ok, but then am i going to have problems to send emails if i delete all from mailqueue table?

or that table is created every time a email is set to be sended?

You seem to be confusing deleting records with deleting the table. You need to delete the records from the table, not the table. If you dont understand this then you need to seek help from someone who does.


All times are GMT. The time now is 06:28 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.01532 seconds
  • Memory Usage 1,829KB
  • 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
  • (13)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