Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Receive email with attachment in VFP
Message
De
31/05/2012 08:56:16
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Divers
Thread ID:
01544911
Message ID:
01544918
Vues:
58
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform