/// <summary> /// Add an instance of the SMTP command factory. /// </summary> /// <param name="smtpCommandFactory">The SMTP command factory.</param> public void Add(ISmtpCommandFactory smtpCommandFactory) { _smtpCommandFactory = smtpCommandFactory; }
/// <summary> /// Constructor. /// </summary> /// <param name="context">The session context.</param> internal SmtpSession(SmtpSessionContext context) { _context = context; _stateMachine = new SmtpStateMachine(_context); _commandFactory = context.ServiceProvider.GetServiceOrDefault <ISmtpCommandFactory>(new SmtpCommandFactory()); }