Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Read and decode an email message
Message
De
22/11/2004 11:02:24
 
 
À
19/11/2004 16:14:54
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:
00963495
Vues:
9
Steve,

The code below is what I use with the Mabry MailX controls.
* If the POP3 control is connected.
IF THISFORM.oPop3.STATE == 3
    * This will be used to know how many email remain to be read.
    THISFORM.nPopMessageCount = THISFORM.oPop3.inbox.COUNT
    * If there are still emails to be processed.
    IF THISFORM.nPopMessageCount > 0
        * Read the 1st one in the inbox.
        THISFORM.oPop3.retrievemessages(THISFORM.oPop3.inbox)
        * Store the 'Physical' email object into this variable.
        loMessage = THISFORM.oPop3.inbox.ITEM(0)

        * This will delete the email. Without flushing it's referance in the above variable.
        THISFORM.oPop3.DELETE(THISFORM.oPop3.inbox.ITEM(0))

    ENDIF
    * Disconnect from the email server.
    THISFORM.oPop3.disconnect

ENDIF
* If there was an email stored in this variable.
IF VARTYPE(loMessage) == "O"
    * Store the senders email & subject
    * of the email into these variables
    lcMailFrom    = loMessage.FROM.ADDRESS
    lcMailSubject = loMessage.subject
    * These are properties that can be used to know the format the email was sent in.
    lcCharSetEmail = ALLT(loMessage.contentsubtypeparameters)
    lcContentType = ALLTRIM(loMessage.ContentType) + "/" + ALLTRIM(loMessage.ContentSubtype)
    * This will be the date the email was sent
    lcCharSentTime = TTOC(loMessage.DATE)
    * These are the headers of the email.
    loHeader = loMessage.Headers
ENDIF
For attachments, you will have use the "PARTS" Property of the email object.
IF loMessage.Parts.COUNT > 0

ENDIF
There is very good help on the mabry site about this.

HTH
Mike
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform