Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Delphi program reading email with TIDMessage component, problem with the body

Posted on 2017-10-09
5
Medium Priority
?
30 Views
Last Modified: 2017-10-11
I use a TIDMessage component (M) to read emails in a Delphi application
Sometime I get as unique first line of the body (M.Body[0]) this : "This is a multipart message in MIME format"
Where can I get the real body of this message ?
Thanks !
0
Comment
Question by:LeTay
  • 3
  • 2
5 Comments
 
LVL 28

Accepted Solution

by:
Sinisa Vuk earned 2000 total points
ID: 42325153
Read more information about how multipart messages ... There is similar question on EE too.
Iterate through M.MessageParts[x] and check ContentType  - depending on content type - use different read method.
If it is plain text then use TIdText(M.MessageParts.Items[idx]).Body but if it is mime encoded - then use Indy functions for Base64/Mine decoding.
0
 

Author Comment

by:LeTay
ID: 42325174
I am a little bit lost with all these sub-components etc...
The originator of the message is an Outlook client
From that client, I send a one line of test body message
Can you provide a sample of Delphi code to get the simple message string ?
Thanks
0
 

Author Comment

by:LeTay
ID: 42325687
Sorry Sinisa, I understood finally the code you posted in your first answer
It works fine !
Many thanks
0
 
LVL 28

Expert Comment

by:Sinisa Vuk
ID: 42326354
One more example to study if you need...
0
 

Author Comment

by:LeTay
ID: 42326429
Thanks
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Integration Management Part 2
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

927 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question