Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mabry Mail Control
Message
From
22/04/1998 10:43:18
 
 
To
22/04/1998 10:36:57
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00093993
Message ID:
00093997
Views:
28
>Thanks for the previous help with this product. I've actually moved pretty far along with it now, but I'm stuck on how it sees the body of a message when there is an attachment. My app can get the mail, save the attachments to disk and tell the user all that. I can display the messages, but if there is an attachment I can't seem to get the body to show up. The book says that if there is an attachment there is no BODY(0), Instead, you have multiple parts, one of which is the attachment and one or more is the body. In my test, I have a message with 2 parts (checked in the debugger). The app steps through the following code and crashes when it tries to look at part 2. Any ideas?
>this code is on a button that displays a message on the screen.
>it crashes on the 2nd time through even thought mmail.parts=2
>originally it was mmail.parts-1, but the code never ran through
>the loop a second time for the second part.
>
>IF thisform.MMail.Parts > 1
> FOR nPrt = 1 TO thisform.MMail.Parts
> thisform.MMail.Part=nPrt
> thisform.mmail.Descend
> if thisform.mmail.contentdisposition > " "
> nBEG=AT('"',thisform.MMail.ContentDisposition)+1
> nEND=AT('"',thisform.MMail.ContentDisposition,2)
> whereisit='c:\temp\'+;
> SUBSTR(thisform.MMail.ContentDisposition,nBEG,nEND-nBEG)
> thisform.lblStatus.Caption = "Attached file saved to "+whereisit
> else
> thisform.txtbody.value = thisform.mMail.body(0)
> endif
> thisform.mmail.Ascend
> endfor
>else
> thisform.txtbody.value = thisform.mMail.body(0)
>endif

whoops! just figured it out...the arrary of parts starts at 0 instead of 1. I should have thought of that 2 days ago!
Previous
Reply
Map
View

Click here to load this message in the networking platform