private static async Task SendResponseAsync(SmtpConnection connection, SmtpResponse response) { LogResponse(response); foreach (var additional in response.AdditionalLines) { await connection.WriteLineAsyncAndFireEvents(additional); } await connection.WriteLineAsyncAndFireEvents(response.ResponseCode + " " + response.ResponseText); }
private static async Task SendResponseAsync(SmtpConnection connection, SmtpResponse response) { LogResponse(response); try { foreach (var additional in response.AdditionalLines) { await connection.WriteLineAsyncAndFireEvents(additional); } await connection.WriteLineAsyncAndFireEvents(response.ResponseCode + " " + response.ResponseText); } catch (Exception ex) { MailServerLogger.Instance.Error(ex); } }
protected async Task SendGreetingAsync(SmtpConnection connectionToSendGreetingTo, string greeting) { if (connectionToSendGreetingTo == null) { throw new ArgumentNullException("connectionToSendGreetingTo"); } var greetingLine = "220 " + greeting; MailServerLogger.Instance.Debug(">>> " + greetingLine); await connectionToSendGreetingTo.WriteLineAsyncAndFireEvents(greetingLine); GreetingSent(this, new SmtpSessionEventArgs(connectionToSendGreetingTo.Session)); }
protected async Task SendGreetingAsync(SmtpConnection connectionToSendGreetingTo, string greeting) { if (connectionToSendGreetingTo == null) throw new ArgumentNullException("connectionToSendGreetingTo"); var greetingLine = "220 " + greeting; MailServerLogger.Instance.Debug(">>> " + greetingLine); await connectionToSendGreetingTo.WriteLineAsyncAndFireEvents(greetingLine); GreetingSent(this, new SmtpSessionEventArgs(connectionToSendGreetingTo.Session)); }
private static async Task SendResponseAsync(SmtpConnection connection, SmtpResponse response) { LogResponse(response); foreach (var additional in response.AdditionalLines) await connection.WriteLineAsyncAndFireEvents(additional); await connection.WriteLineAsyncAndFireEvents(response.ResponseCode + " " + response.ResponseText); }
private static async Task SendResponseAsync(SmtpConnection connection, SmtpResponse response) { LogResponse(response); try { foreach (var additional in response.AdditionalLines) await connection.WriteLineAsyncAndFireEvents(additional); await connection.WriteLineAsyncAndFireEvents(response.ResponseCode + " " + response.ResponseText); } catch(Exception ex) { MailServerLogger.Instance.Error(ex); } }