@@ -40,13 +40,16 @@ private SmtpClient InitSmtpClient()
4040 var client = new SmtpClient ( ) ;
4141
4242 client . ServerCertificateValidationCallback = ( s , c , h , e ) => true ;
43- if ( ! Options . SSL )
43+
44+
45+ if ( ! Options . Security )
4446 {
4547 client . Connect ( Options . Server , Options . Port , SecureSocketOptions . None ) ;
4648 }
4749 else
4850 {
49- client . Connect ( Options . Server , Options . Port , SecureSocketOptions . SslOnConnect ) ;
51+ // fix issue #6
52+ client . Connect ( Options . Server , Options . Port , SecureSocketOptions . Auto ) ;
5053 }
5154
5255 // Note: since we don't have an OAuth2 token, disable
@@ -81,7 +84,7 @@ private Pop3Client InitPop3Client()
8184 var client = new Pop3Client ( ) ;
8285
8386 client . ServerCertificateValidationCallback = ( s , c , h , e ) => true ;
84- client . Connect ( Options . Server , Options . Port , Options . SSL ) ;
87+ client . Connect ( Options . Server , Options . Port , Options . Security ) ;
8588
8689 // Note: since we don't have an OAuth2 token, disable
8790 // the XOAUTH2 authentication mechanism.
@@ -114,7 +117,7 @@ private ImapClient InitImapClient()
114117 {
115118 var client = new ImapClient ( ) ;
116119
117- client . Connect ( Options . Server , Options . Port , Options . SSL ) ;
120+ client . Connect ( Options . Server , Options . Port , Options . Security ) ;
118121
119122 // Note: since we don't have an OAuth2 token, disable
120123 // the XOAUTH2 authentication mechanism.
0 commit comments