Den 19-06-2011 17:57, Jimmy Cao skrev:
On Sun, Jun 19, 2011 at 5:29 AM, jdrewsen <jdrew...@nospam.com
<mailto:jdrew...@nospam.com>> wrote:

    Very nice. A couple of things I believe would help:
    1, Get rid of MailMessageData and use curl.onSend() and a delegate
    that keeps a reference to the message. That way you don't have to
    use the lower level Curl.set(infile/readfunction) calls as well.


Ah, that makes it much better.

    2, It would be nice if the static sendMail(...) function worked like
    the Http/Ftp counterparts. They return a Result object that you can
    change before performing the actual task. That way you can easily
    set timeouts etc. If there shouldn't be support for async smtp then
    this is probably not important though.


There should be support for async SMTP.
The problem is this:
SMTP.sendMailAsync(...).connectTimeout(dur!"seconds"(60)).localPort(25).?

byLine, byChunk, etc don't make much sense there.

I think it would be better to get rid of the static sendMail function,
and write a performAsync method.
I'm not sure though.
Something like this:
https://gist.github.com/1034433

Maybe i doesn't make sense to provide the async interface at all? Users needing to do it async could just as well create a delegate and call spawn themselves.

/Jonas

Reply via email to