Free Support Forum -

Is SmtpClient object can be reuse?

i use to send a lot of mail, now when i send each of mail, i will recreate a SmtpClient object, my question is: can i reuse only one SmtpClient instance to send all of the mail?

i have test this idea, when send some little amount email, the app will be ok, but in later, the “send message failure” will be occurred frequently.

how can i do? thanks

i don’t want to use SmtpClientBulkSendAgent class, because in our situlation, we need handle each email in every sending.

Hi Pyntia,

The same SmtpClient object can be used multiple times but depending upon the network connection behavior, you may need to re-initialize based on disconnection. I have tried this for approximately around 30 minutes and the same object sends out emails successfully. Could you please specify how long your app keeps sending the emails and in what scenario you get “Send message failure” message?