Esempio n. 1
0
 private SmtpReply executeCommand(SmtpCommand command)
 {
     switch (command.CommandCode) {
         case "EHLO":
             return connect(command);
         case "MAIL":
             return createMail(command);
         case "RCPT":
             return addRecipient(command);
         case "DATA":
             return startReadingData();
         case "RSET":
             return interrupt();
         case "QUIT":
             return quit();
     }
     throw new InvalidOperationException("Command Not Understood: " + command.CommandCode);
 }
Esempio n. 2
0
 private SmtpReply connect(SmtpCommand command)
 {
     sender = command.Parameters;
     return SmtpReply.Ok;
 }
Esempio n. 3
0
 private SmtpReply createMail(SmtpCommand command)
 {
     currentMessage = new SmtpMessage();
     currentMessage.From = command.Parameters;
     return SmtpReply.Ok;
 }
Esempio n. 4
0
 private SmtpReply addRecipient(SmtpCommand command)
 {
     currentMessage.Recipients.Add(command.Parameters);
     return SmtpReply.Ok;
 }