Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Receive email with attachment in VFP
Message
From
31/05/2012 08:56:16
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01544911
Message ID:
01544918
Views:
57
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform