Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read and decode an email message
Message
De
24/11/2004 10:13:42
 
 
À
22/11/2004 11:02:24
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
MS SQL Server
Divers
Thread ID:
00963046
Message ID:
00964292
Vues:
11
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
   * other processing on oMsg
ENDFOR
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform