Reusing mailer (SmtpTransport) #791
-
Hi, is it okay to reuse mailer ( Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You should re-use the same transport for as long as possible as it stores it's own configuration for you. Also if the |
Beta Was this translation helpful? Give feedback.
You should re-use the same transport for as long as possible as it stores it's own configuration for you. Also if the
pool
feature is on (it is by default) it recycles connections and reduces the need to do a new computationally expensive TLS handshake for every email you're going to send plus avoiding the slowness of having to do multiple round-trips to establish a TCP connection, authenticate ecc. If the underlying connection disconnects or times out the transport is going to throw it away and make a new one.