Confirming cron command w/php & Sending Mail Via Cron

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
jbh
Forum Commoner
Posts: 89
Joined: Tue Dec 05, 2006 7:01 pm

Confirming cron command w/php & Sending Mail Via Cron

Post by jbh »

Hey,

When using a php page to be activated via cron, do I have to use any prefixes such as
-q or /path/to/php before the path to the file, such as

/path/to/php /home/public_html/wwwsite/cronpage.php ?

Also, if I were to use swiftmailer, or any mailer for batch email via cron, is it recommended to sleep 10-30 seconds
during each loop through a database record? Or should it sleep a minute+ before sending another batch? (for instance, up to 100 emails at a time
if the shared server allows it (mine allows 1k)

Thanks
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Confirming cron command w/php & Sending Mail Via Cro

Post by John Cartwright »

jbh wrote:Hey,

When using a php page to be activated via cron, do I have to use any prefixes such as
-q or /path/to/php before the path to the file, such as

/path/to/php /home/public_html/wwwsite/cronpage.php ?

Also, if I were to use swiftmailer, or any mailer for batch email via cron, is it recommended to sleep 10-30 seconds
during each loop through a database record? Or should it sleep a minute+ before sending another batch? (for instance, up to 100 emails at a time
if the shared server allows it (mine allows 1k)

Thanks
I don't think so, although I havn't really looked into it. The real reason I posted was if you are using SwiftMailer you can use it's AntiFlood plugin.
jbh
Forum Commoner
Posts: 89
Joined: Tue Dec 05, 2006 7:01 pm

Post by jbh »

Yeah, I am going to use that ,actually. And test it tonight. I guess I just tell it to batch x # and pause every y seconds.


As for the cron ,I've searched (and other boards) and get conflicting responses to control panel cron syntax, if the php path is necessary or using -q

What do you recommend?

Thanks
Post Reply