我在處理 OpenPop 來讀取電子郵件正文時遇到問題。我認(rèn)為問題是我不知道如何處理圖像。我的最小代碼是:for (int i = messageCount; i > 0; i--) { ProcessMessage(client.GetMessage(i)); //the standard call in all examples client.DeleteMessage(i); }public static void ProcessMessage(Message msg) { //Parse Message string from = msg.Headers.From.Address; string subject = msg.Headers.Subject; string body = ""; DateTime received = msg.Headers.DateSent; if (msg.MessagePart.IsMultiPart == false) { body = msg.MessagePart.GetBodyAsText(); } else { for (int i = 0; i < msg.MessagePart.MessageParts.Count; i++) { MessagePart part = msg.MessagePart.MessageParts[i]; body += part.GetBodyAsText(); **//This is my error line** } }我收到字節(jié)數(shù)組不能為空的錯誤。我不明白我缺少什么,但是當(dāng)正文中有圖像(通常在簽名中)時,就會發(fā)生此錯誤。
OpenPop 無法讀取電子郵件正文
墨色風(fēng)雨
2023-08-20 09:55:45