Home » Mail » Mail » Bug #4122
persistant smtp connections
Details
| Request #4122 | persistant smtp connections |
|---|---|
| Submitted | 2005-04-11 22:06 UTC |
| From | randy at rcs-comp dot com |
| Assigned | jon |
| Status | Closed |
| Package | |
| PHP Version | Irrelevant |
| Roadmaps | (Not assigned) |
Comments
[2005-04-11 22:06 UTC] randy at rcs-comp dot com
Description:
------------
I have modified the MAIL/smtp.php factory so that send()
can be accomplished with a persistent SMTP connection. With my modification, the socket connection is kept for multiple sends instead of being connected every time. I realize this is not a big deal for most people since their webserver and email server are on the same hostor at least on the same network. However, when I locally develop I like to test email sending from the target email server which has to first go out my slow broadband connection. As you can imagine, using mail_queue processing the queue takes a long time. This modification shaved off about 60% of the time it took to send 50 emails (I only compared once so it might not be
that good of a test)
PLEASE NOTE THE BASE VERSION I MODIFIED:
MAIL = 1.1.4
I used a register_shutdown_function to close the persistant connection. I am not up to date with PHP5 objects yet so I am not sure if that is the best way to do it or if you are going for destructor use now.
Reproduce code:
---------------
http://www.rcs-comp.com/phpcode/newsmtp.php.txt
use this to activate it:
$params['persistent'] = true;
[2005-05-16 20:27 UTC] randy at rcs-comp dot com
http://www.rcs-comp.com/phpcode/smtp.diff