Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 3
0
        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));
        }
Ejemplo n.º 4
0
        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));
        }
Ejemplo n.º 5
0
        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);
        }
Ejemplo n.º 6
0
        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);
            }
        }