AntonioCuomo Posted April 10, 2022 Share Posted April 10, 2022 I try to read the content of the emails downloaded with tidimap4: //-------------------------------------------------------- for i := 0 to TCount-1 do begin IdIMAP41.GetUID(i+1, TheUID); IdIMAP41.UIDRetrieveFlags(TheUID, TheFlags); IdIMAP41.UIDRetrieveHeader(TheUID, MSG); MSG.MessageParts.CountParts; pp := msg.MessageParts.TextPartCount; if NOT (mfSeen in TheFlags) then begin // UnRead message! if not(FDTHeader.FindKey([MSG.MsgId])) then begin //------------------------------------------------------ // Legge body //------------------------------------------------------ try if pp > 0 then begin for var k := 0 to msg.MessageParts.Count - 1 do begin if msg.MessageParts[k] is TIdText then begin S := S + TIdText(msg.MessageParts[k]).Body.Text; end else begin s := msg.body.text; end; end; end; finally bodytext := s; with vcl application it works fine, but with unigui I can't read the number of parts of the message. In practice the function msg.messageparts.countparts in unigui gives me as a result 0. Quote Link to comment Share on other sites More sharing options...
AntonioCuomo Posted April 10, 2022 Author Share Posted April 10, 2022 Fixed mancava re-reading the message: //------------------------------------------------------ // Legge body //------------------------------------------------------ IdIMAP41.UIDRetrieve(TheUID, MSG); MSG.MessageParts.CountParts; pp := msg.MessageParts.TextPartCount; try... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.