Closed arthurchiakh closed 3 years ago
Hi, @nblumhardt , do you mind checking this PR? This change is to let user to specify secure socket option setting for MailKit, which can increase the range of supported email servers for this library. In my case, I can only connect to Office365 email server when the secure socket option set to SecureSocketOptions.StartTls. Please see also related issue #69 Mailkit client use SecureSocketOptions .
I would like to see this merged as well, I need to set the SecureSocketOptions in order to send email in my environment.
Thanks for the nudge. I would prefer not to expose MailKit
types directly on the email sink's API - is there a higher-level way this can be expressed, akin to how we currently set EnableSSL
?
@nblumhardt
EnableSSL
is a bit simpler because it's a boolean on both ends, whereas SecureSocketOptions
is an enum. At some point, the enum will have to be validated to ascertain whether it's valid. This seems to lead to paths like creating your own enum with the same values as SecureSocketOptions
, etc. Or, casting it in some manner and doing an automatic mapping. One way or the other, enum/type mapping seems unavoidable, so it seems like it's a matter of how you prefer to structure the sink code.
Thanks for the nudge. I would prefer not to expose
MailKit
types directly on the email sink's API - is there a higher-level way this can be expressed, akin to how we currently setEnableSSL
?
I think this sink should introduce an enum similar or the same to SecureSocketOptions to avoid dependency on MailKit. And have one-to-one mapping between these enums. Come on, guys, lets finish this, it will be very useful!
Introducing an enum that maps to MailKit's one sounds reasonable 👍
I'm sorry guys, better late than never. I have added a dedicated Enum to map the MailKit socket options.
@nblumhardt please review my latest change. Thanks loads.
@nblumhardt @andriysavin I already changed the code accordingly. Please let me know anything that I can improve. Thanks.
@nblumhardt Hi, can you have a look on this?
@nblumhardt please, take a look
Righto! 👍 Let's give this a try on dev
😎
@nblumhardt Is there a package feed for dev branch?
@nblumhardt Is there a package feed for dev branch?
I believe this is the one. https://www.nuget.org/packages/Serilog.Sinks.Email/2.4.1-dev-00128
Thank you for your contribution, It's very helpful to me.
Thanks for this, The pre-release code resolves my issue as well. Any idea when the final release will be published?
related to Issue #69
Enable user to set secure socket option for MailKit