Skip to content

Reusing mailer (SmtpTransport) #791

Answered by paolobarbolini
holubond asked this question in Q&A
Discussion options

You must be logged in to vote

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.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@DK26
Comment options

Answer selected by holubond
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants