public MailMessageEx Top(int messageId, int lineCount) { if (messageId < 1) { throw new ArgumentOutOfRangeException("messageId"); } if (lineCount < 0) { throw new ArgumentOutOfRangeException("lineCount"); } RetrResponse response; using (var command = new TopCommand(_clientStream, messageId, lineCount)) { response = ExecuteCommand <RetrResponse, TopCommand>(command); } var reader = new MimeReader(response.MessageLines); var entity = reader.CreateMimeEntity(); var message = entity.ToMailMessageEx(); message.Octets = response.Octets; message.MessageNumber = messageId; return(entity.ToMailMessageEx()); }
/// <summary> /// Adds the child entity. /// </summary> /// <param name="entity">The entity.</param> private void AddChildEntity(MimeEntity entity, Queue <string> lines) { /*if (entity == null) * { * return; * } * * if (lines == null) * { * return; * }*/ var reader = new MimeReader(entity, lines); entity.Children.Add(reader.CreateMimeEntity()); }
/// <summary> /// Retrs the specified message. /// </summary> /// <param name="item">The item.</param> /// <returns>A MimeEntity for the requested Pop3 Mail Item.</returns> public MimeEntity RetrMimeEntity(Pop3ListItem item) { if (item == null) { throw new ArgumentNullException("item"); } if (item.MessageId < 1) { throw new ArgumentOutOfRangeException("item.MessageId"); } RetrResponse response; using (var command = new RetrCommand(_clientStream, item.MessageId)) { response = ExecuteCommand <RetrResponse, RetrCommand>(command); } var reader = new MimeReader(response.MessageLines); return(reader.CreateMimeEntity()); }
/// <summary> /// Adds the child entity. /// </summary> /// <param name="entity">The entity.</param> private void AddChildEntity(MimeEntity entity, Queue<string> lines) { /*if (entity == null) { return; } if (lines == null) { return; }*/ MimeReader reader = new MimeReader(entity, lines); entity.Children.Add(reader.CreateMimeEntity()); }