Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Receive email with attachment in VFP
Message
 
 
À
31/05/2012 13:01:01
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01544911
Message ID:
01544967
Vues:
45
Thank you.

>The way I use it.....It's the reference to the individual email item contained within each folder in outlook. I send it to check for attachments and if any, save them with;
>
>
>	IF loItem.Attachments.Count > 0
>	        This.SaveAttachments( loItem )
>	ENDIF
>
>
>>Thank you. I will see how this code could be applied. BTW, what tool/code do you use to create the object toMsg?
>>>How about something like this?
>>>
>>>
>>>FUNCTION SaveAttachments( toMsg )
>>>		LOCAL	loAttachment,  lcFileName
>>>		*** Saves the attachments associated with the current message to the specified file name
>>>		FOR EACH loAttachment IN toMsg.Attachments
>>>
>>>* send attachment files into a subdir
>>>* append "ATTACH\"
>>>			lcFileName = FULLPATH( CURDIR() + this.cDirAttach ) + loAttachment.FileName
>>>            if !empty( m.lcFileName )
>>>			loAttachment.SaveAsFile( lcFileName )
>>>			*** Make sure it was saved
>>>			*** The SaveAsFile method returns null...it doesn't tell us about success or failure
>>>			IF FILE( lcFileName )
>>>				*** ok...now add it to the table
>>>				INSERT INTO SaveAttach ( omMailFK, attFname ) VALUES ( SaveMail.omMailPK, lcFileName )
>>>			ENDIF
>>>            endif
>>>		ENDFOR
>>>	ENDFUNC
>>>
>>>
>>>>Hi,
>>>>
>>>>I am looking for a method to receive email(s) in VFP and separate attachment from each email message. I looked at the code in the following link (which is useful but does not seem to have the way to get the attachment too)
>>>>
>>>>http://www.berezniker.com/content/pages/visual-foxpro/read-pop3-mail-using-winsock
>>>>
>>>>I also looked at the West Wind wwPop3 class but don't see how to separate an attachment from email either.
>>>>
>>>>Any other suggestions? Or maybe I am missing something in the wwPop3. Please let me know. Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform