I\'m using Zend_Mail in a Zend Framework application to send an e-mail with the contents of a web-based contact form.
The mailing itself works fine ( im using a Goog
PHP doesn't allow multi-threading by default. Some ways to get your work done:
Use some message queue service like IronMQ [recommended approach] which makes a secure API/cURL call to your system and spawns off a separate process w/o blocking execution.
Use output buffering in PHP and use ob_flush before finally starting the mail sending operation.
Make the client call the server again via AJAX on success of previous operation.
Install pthreads PECL extension on your server