tags:

views:

79

answers:

2

How can i send 1 mail to 1000 person with php, and not to wait 10 hours?

It's possible to set an cronjob from php?

sorry my English! and thanks a lot

+4  A: 

You can go for SwiftMailer, it has the bulk email option other than other great options. It also has authentication feature which means your emails may not be treated as spam.

It's possible to set an cronjob from php?

Yes, it is possible, see how to setup a cron job.

Sarfraz
I think your Cronjob link does not answer his actual question. He asked how to set an cronjob from inside a PHP script (at least that's my understanding).
halfdan
-1: authentication has nothing to do with whether your emails are treated as spam.
symcbean
+2  A: 

99.9% of this question is all about MTAs (mail transport agents - Sendmail, Postix, MS-Eschange etc) and nothing to do with PHP.

How can i send 1 mail to 1000 person with php, and not to wait 10 hours?

That's not a lot - if its taking 10 hours then your system is specifically configured to prevent bulk emailing or your code is truly dreadful. You'll get better throughput if you can put as many addresses as possible on the envelope. I would guess that if you're sending messages to this many users you don't want all the addresses to appear in the 'to' header? Which means adding bcc headers for 50 or so addresses at a time.

Do you control your MTA? Does it rely on a smart relay?

It's possible to set an cronjob from php?

Do you mean create a cron job from PHP? Yes, that's possible, but not a good idea so most admins will prevent it. Or do you mean you want to run a PHP script as a cron job? Yes - assuming that you have the CLI version of PHP available on the system where cron runs - or a dumb http client like wget / curl.

C.

symcbean