Re: SMTP return values
| From: | Jon Parise | Date: | Fri, 10 Jan 2003 20:59:06 +0000 |
| Subject: | Re: SMTP return values | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-12252@lists.php.net to get a copy of this message | ||
On Mon, Jan 06, 2003 at 10:13:14AM -0300, Damian Fernandez Sosa (DESC) wrote:
> * the validateResponse() function (and validateAndParseResponse())
> should accept an array as parameter or should check if the parameter
> is a String or array because sometimes a VALID response could have
> more than a return code (sometimes 251 is also a valid response)
That is now possible. See the new _parseResponse() method.
> * the validateResponse() function (and validateAndParseResponse())
> should return the response on succes or pear_error on fail.
_parseResponse() now returns true on success or a PEAR_Error object on
failure. The response (code and arguments) are available internally
from private member variables or externally via the getResponse()
method.
> * the class should have a dataFromFile() method to allow to send the
> email from a file and optimize the memory usage whith very large
> emails
I disagree. The message will ultimately be send as a string, and
there's no need for the Net_SMTP class to be aware of file IO.
Perhaps we could pass the string of message content around by
reference to improve performance, however. I'll play with that idea.
> * allow to set a timeout (puting the socket in non-blocking mode)
> if the email server don't respond, timeout with an error AFTER XXX
> seconds. This could be to avoid dead-locks in the script.
That's a good idea. I'll look at adding that soon, as well.
--
Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)