danzuep / MailKitSimplified

Send and receive emails easily, fluently, with one line of code for each operation.
MIT License
61 stars 8 forks source link

SecureSocketOptions are not transmitted to ConnectAsync method #45

Closed Sylar-A closed 8 months ago

Sylar-A commented 8 months ago

Hello! I have a problem: mailkit.net.imap.imapprotocolexception the imap server has unexpectedly disconnected. And i found a solution on stackoverflow: https://stackoverflow.com/questions/42292617/the-imap-server-has-unexpectedly-disconnected-using-993-port-and-mailkit After that i started digging in your code and found an option to hand over this value from appsettings (if i clearly understand). https://github.com/danzuep/MailKitSimplified/blob/be282637416ff8c9b78ab14315a1ec24e7f2313b/source/MailKitSimplified.Receiver/Models/EmailReceiverOptions.cs#L27 But there is a small problem that this parameter is not passed in method ConnectAsync on line 79: https://github.com/danzuep/MailKitSimplified/blob/be282637416ff8c9b78ab14315a1ec24e7f2313b/source/MailKitSimplified.Receiver/Models/EmailReceiverOptions.cs#L79 Could you please pass this parameter in method, please? And if you do, please show an example of using this parameters in appsettings. Best regards.

danzuep commented 8 months ago

Hi Sylar, thanks for pointing out that mistake. ImapReceiver.ConnectAuthenticatedImapClientAsync is currently being used instead of CreateImapClientAsync, but I've fixed it anyway in case someone does want to use it in the future.

I've added some more appsettings.json examples to the wiki now, let me know how it goes.

Sylar-A commented 8 months ago

Hello again! I've tested it and it works at the first blush. Thank you!