Hi all,
I used to develop web application using Java. For example in user registration to our web app, we usually send the activation code via email. In Java, usually I create a new thread and put the email sending process in this new thread so it does not blocked the rest of the code execution. I am relatively new to PHP, what should we do it in Yii/PHP?
Thank you for your help.
Kind regards,
Daniel
Page 1 of 1
New thread for sending email
#3
Posted 15 March 2010 - 08:58 AM
Alternatively you can create a console command (or pure php, whatever you like) and run it as background process (so it won't block php execution).
Example:
You may put that into a php class so you can simply do:
Example:
exec('/usr/bin/php -f /var/www/index.php sendmail "to@address.com" "title" "body" > /dev/null &');You may put that into a php class so you can simply do:
$mail = new Mail; // set receiver, subject, ... $mail->send();
Share this topic:
Page 1 of 1

Help















