go-smtp icon indicating copy to clipboard operation
go-smtp copied to clipboard

client: add InitConn method

Open kayrus opened this issue 3 years ago • 4 comments

InitConn() method allows to set the client's connection after the smtp.Client variable initialization with custom timeouts.

resolves #175

kayrus avatar Dec 16 '21 16:12 kayrus

This doesn't sound like a great API. Instead, what about adding a ClientOptions arg to NewClient?

emersion avatar Dec 21 '21 13:12 emersion

I didn't want to break the backward compatibility and make it as much transparent as possible. I'm fine to introduce ClientOptions with a new function like NewClientWithOptions or NewClientOpts.

kayrus avatar Dec 21 '21 14:12 kayrus

Works for me.

emersion avatar Dec 21 '21 14:12 emersion

Alternative approach in https://github.com/emersion/go-smtp/pull/184

emersion avatar May 02 '22 16:05 emersion

Superseded by https://github.com/emersion/go-smtp/pull/184

emersion avatar Dec 27 '23 13:12 emersion