Menu

The problem of Smtp.SendMail()

Weber Wang
2004-01-21
2004-01-23
  • Weber Wang

    Weber Wang - 2004-01-21

    I think there have a resource leak in this method, because when an exception is thrown, the CloseConnection() have not called, I think all this method need to put in a try block, and call CloseConnection() in the finally block, in the other hand, the CloseConnection() should set all resource to null, and in GetConnection() call CloseConnection() first to ensure all resources have released especially the TCPClient object.

     
    • Ian Stallings

      Ian Stallings - 2004-01-23

      This is a good suggestion but I have to find a way to work around firing the ConnectionClosed event so many times (before sending mainly). I'll work around this and add it to the next release.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.