Re: SMTP return values
| From: | DESC) | Date: | Mon, 06 Jan 2003 13:13:14 +0000 |
| Subject: | Re: SMTP return values | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-12160@lists.php.net to get a copy of this message | ||
I think that should be useful those changes for debuging.
Also:
* 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)
* the validateResponse() function (and validateAndParseResponse()) should return
the response on succes or pear_error on fail.
* 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
* 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.
I can make if you agree those changes and send every change as a path to you.
Mensaje citado por Jon Parise <jon@php.net>:
> As you've probably seen, I've been refactoring the Net_SMTP package a
> bit.
>
> The current class interface provides methods that map directory to
> their SMTP command counterparts (e.g. helo(), data(), vrfy()). At the
> moment, these methods return either 'true' upon success or a PEAR_Error
> object if a failure condition is encountered.
>
> I'm considering changing the API to instead return a 2-tuple
> containing the SMTP response code and message instead of the rather
> vague 'true' value. Errors would still result in a PEAR_Error object
> being returned.
>
> This change would make the class slightly more difficult to use as the
> burden of checking for a correct response code would fall to the user.
> The class would become more flexible, however, in that it would expose
> more of the details regarding the SMTP conversation.
>
> At this point, I can see arguments either way, and I don't have an
> incredibly strong preference for one implementation over the other. I
> think it's worth some thoughtful discussion, however, which is why I
> introduce the topic here.
>
> --
> Jon Parise (jon@php.net) :: The PHP Project (http://www.php.net/)
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
-------------------------------------------------
Mail enviado desde el CNBA
http://www.cnba.uba.ar/
-----