myloveCc/NETCore.MailKit

no authentication error

dragouf opened this issue · 2 comments

Authentication should be optional.
When I don't add any username and password it return a null exception error.

+1 and it's a very easy fix. Inside MailKitProvider.cs change the client.Authenticate lines to something like this:
if (!string.IsNullOrEmpty(Options.Account)) { client.Authenticate(Options.Account, Options.Password); }

I created a custom implementation of MailKitProvider very similar to the one in source, with these changes, manually registered to the IoC container and it's working fine.

I have fix this issues ,thanks !