Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Receive email with attachment in VFP
Message
 
 
To
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:
01544933
Views:
50
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform