System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult.SendHello C# (CSharp) Method

SendHello() private method

private SendHello ( ) : bool
return bool
            private bool SendHello()
            {
                IAsyncResult result = HelloCommand.BeginSend(_connection, _connection._client.clientDomain, s_sendHelloCallback, this);
                //if ehello isn't supported, assume basic auth
                if (result.CompletedSynchronously)
                {
                    _connection._supportedAuth = SupportedAuth.Login;
                    HelloCommand.EndSend(result);
                    Authenticate();
                    return true;
                }
                return false;
            }

Usage Example

 private static void HandshakeCallback(IAsyncResult result)
 {
     if (!result.CompletedSynchronously)
     {
         SmtpConnection.ConnectAndHandshakeAsyncResult asyncState = (SmtpConnection.ConnectAndHandshakeAsyncResult)result.AsyncState;
         try
         {
             try
             {
                 LineInfo info = asyncState.connection.Reader.CurrentReader.EndReadLine(result);
                 if (info.StatusCode != SmtpStatusCode.ServiceReady)
                 {
                     asyncState.InvokeCallback(new SmtpException(info.StatusCode, info.Line, true));
                 }
                 else if (!asyncState.SendEHello())
                 {
                 }
             }
             catch (SmtpException)
             {
                 if (!asyncState.SendHello())
                 {
                 }
             }
         }
         catch (Exception exception)
         {
             asyncState.InvokeCallback(exception);
         }
     }
 }
All Usage Examples Of System.Net.Mail.SmtpConnection.ConnectAndHandshakeAsyncResult::SendHello