Thanks for the reply. I think I am pretty close to getting what I want using the CDO classes in Window. I am posting the following as a new message on the forum.
I want to take a base64 encoded email message string into a CDO.Message object. I have succeeded when I store the decoded string into a file and used the CDO DropDirectory GetMessages method (see below). However, I would like to bypass writing the string out to a file and read it more directly into a CDO.Message.
It appears that the string has to be inserted into the message object via an ADO stream object. The OpenObject method is on the IDataSource interface of the Message object, so I tried the code below.
cMsg = strConv(cEncodedString,14)
oStream = CreateObject("ADODB.Stream")
oStream.Open()
oStream.WriteText(cMsg)
oMsg = CREATEOBJECT("CDO.Message")
oMsg.DataSource.OpenObject(oStream,"_Stream")
cTo = oMsg.To
So far the oMsg object seems to be ignoring my attempt the import the email string. All the important properties of oMsg are emtpy. Does anybody out there know how to achieve getting the email string into the Message object?
If I use strConv to decode the base64 string and save the result to a file with an eml extension, I can use the CDO objects in Windows to get the email into a CDO message object. E.G.
oDropDir = CREATEOBJECT("CDO.DropDirectory")
oMsgs = oDropDir.GetMessages("C:\temp")
FOR EACH oMsg IN oMsgs
cTo = oMsg.To
nRecipients = ALINES(laRecipients,cTo,.T.,",",";")
FOR EACH lcRecipient IN laRecipients
? lcRecipient
ENDFOR
ENDFOR