PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Mail » Mail_Queue » Bug #4028

MS SQL container && persistant SMTP connection

Details

Request #4028MS SQL container && persistant SMTP connection
Submitted2005-04-01 21:28 UTC
Fromrandy at rcs-comp dot com
Assignedquipo
StatusClosed
PackageMail_Queue
PHP Version5.0.2
Roadmaps(Not assigned)

Comments

[2005-04-01 21:28 UTC] randy at rcs-comp dot com

Description:
------------
I have modified the db container so that it works with a mssql database. I have not tested every function, but putting mail into the DB and sending mail works.

http://www.rcs-comp.com/phpcode/mssqldb.php.txt

SQL for setting up the DB:

http://www.rcs-comp.com/phpcode/mssqldb.sql.txt

In addition, 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 host or 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, 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)

http://www.rcs-comp.com/phpcode/newsmtp.php.txt

PLEASE NOTE THE BASE VERSIONS I MODIFIED:
MAIL = 1.1.4
MAIL_QUEUE = 1.1.3

Reproduce code:
---------------
// Use other mail options as needed
$mail_options['driver'] = 'newsmtp';
$params['persistent'] = true;

// Use other DB options as needed
$db_options['type'] = 'mssqldb';

/* TO SEND MAIL OR PUT MAIL IN DB WORKS THE SAME AS THE EXAMPLES FOR THIS PROJECT */

[2005-04-01 21:42 UTC] randy at rcs-comp dot com

Fixed a few errors in newsmtp.php

[2005-04-11 21:59 UTC] randy at rcs-comp dot com

I tried the query with date() and it did not work. At least in the MSDE version of MSSQL, date() is not a funciton.

As for $db->modifyLimitQuery(), MSSQL does not have a good limit equivalent. In the db package, modifyLimitQuery just returns, it doesn't actually affect the query.