示例#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);
 }
示例#2
0
 private SmtpReply connect(SmtpCommand command)
 {
     sender = command.Parameters;
     return SmtpReply.Ok;
 }
示例#3
0
 private SmtpReply createMail(SmtpCommand command)
 {
     currentMessage = new SmtpMessage();
     currentMessage.From = command.Parameters;
     return SmtpReply.Ok;
 }
示例#4
0
 private SmtpReply addRecipient(SmtpCommand command)
 {
     currentMessage.Recipients.Add(command.Parameters);
     return SmtpReply.Ok;
 }