How can I send an email to 1000 people or more using PHP, without having to wait 10 hours while it works? Is it possible to set a c开发者_运维知识库ronjob from PHP?
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.
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.
精彩评论