private string ReceiveMultiLineResponse() { string cursor = EmailStreamReader.ReadLine(); string response = string.Empty; while (cursor != ".") { response += cursor + '\n'; cursor = EmailStreamReader.ReadLine(); } return(response); }
protected override void ReceiveResponse() { string response = string.Empty; if (!IsMultiLineResponse) { response = EmailStreamReader.ReadLine(); } else { response = ReceiveMultiLineResponse(); } Response = response; }
protected override void ReceiveResponse() { bool isEnd = false; string response = string.Empty; string cursor = string.Empty; while (!isEnd) { cursor = EmailStreamReader.ReadLine(); response += cursor + "\n"; if (cursor.StartsWith(IMAP_PREFIX + "OK") || cursor.StartsWith(IMAP_PREFIX + "NO") || cursor.StartsWith(IMAP_PREFIX + "BAD")) { isEnd = true; } } Response = response; }