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

Click here to load this message in the networking platform