Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<h2>Google App Engine</h2> <p>I would write this in Google app engine (python) because:</p> <ul> <li>It scales well.</li> <li>It has a good email api.</li> <li>It has a taskqueue with a good api to access it.</li> <li>Because python is a real nice language.</li> <li>It is (relatively) cheap.</li> </ul> <h2>PHP</h2> <p>If I would implement it in PHP I would</p> <ul> <li>Find yourself a good SMTP server which allows you to sent this volume of mails because Gmail will not allow you to sent this kind of volume. I am for sure that this will cost you some money.</li> <li>Find yourself a decent PHP email library to sent messages with like for example PHPMailer like you said.</li> <li>Use a message queue like for example beanstalkd to put email messages in queue and sent email asynchronously. First because with this the user will have snappier page load. Second with a message queue like beanstalkd you can regulate speed of sending better which will prevent from overloading your pc with work. You will need to have ssh access to the server to compile(install) beanstalkd. You can find beanstalkd at <a href="http://kr.github.com/beanstalkd/download.html" rel="noreferrer">beanstalkd</a></li> <li>You would also need ssh access to run a PHP script in the background which will process the message queue. You can find a beanstalkd-client at <a href="http://github.com/pda/pheanstalk/" rel="noreferrer">php beanstalkd-client</a></li> </ul> <h2>from php/apache/webpage</h2> <p>This is the page from which you will sent messages out to user. From this page you will sent message to beanstalkd by coding something in the lines of this:</p> <pre><code>// register Pheanstalk class loader require_once('pheanstalk_init.php'); $pheanstalk = new Pheanstalk('127.0.0.1'); $message = ""; // This would contain your message $pheanstalk-&gt;put(json_encode($message); </code></pre> <p>You have to put messages in message queue using put command</p> <h2>From long running PHP script in background:</h2> <p>The code would look something like this:</p> <pre><code>// register Pheanstalk class loader require_once('pheanstalk_init.php'); $pheanstalk = new Pheanstalk('127.0.0.1'); while(true) { $job = $pheanstalk-&gt;reserve(); $email = json_decode($job-&gt;getData()); // Sent email using PHP mailer. $pheanstalk-&gt;delete($job); } </code></pre> <p>Like I am saying it is possible with both PHP and Google app engine but I would go for app engine because it is easier to implement.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload