Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Attachments in Outlook from VFP
Message
From
23/01/2003 17:36:52
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Attachments in Outlook from VFP
Miscellaneous
Thread ID:
00744895
Message ID:
00744895
Views:
45
I am succesfully sending emails via Outlook. But I want to attach a text file and the text file is being put RIGHT INTO the email. How do I get this to really attach the file? Code is below.
And in the email message has a ton of garbage (see below). Is this because the attachement is going right into the email?

Any help would be great!
Thanks - Mark

---------------------------------------------------------
CODE
---------------------------------------------------------

myOlApp = CREATEOBJECT("Outlook.Application")
myItem = myOlApp.CreateItem(0) &&Creates a message
myNameSpace = myOlApp.GetNameSpace("MAPI")
myNameSpace.LogOn(.cSender, .cSender_Password)

myItem.Subject = goApp.cToExport
myItem.Body = goApp.cEmailBodyText

myItem.To = .cRecipient_Email_Address

** Attach Text file
lcFullPathForClaimAttachment = SYS(5) + SYS(2003) + "\" + This.cClaimFileName
myAttachments = myItem.Attachments &&Creates a collection of attachments
FileAtt='myAttachments.Add("'+ lcFullPathForClaimAttachment +'")' &&Adds an attachment to the collection
&FileAtt


myItem.Send
myNameSpace.LogOff
ENDWITH

SELECT (lnSelect)
RETURN llRetval
ENDPROC

---------------------------------------------------------
EMAIL MESSAGE
---------------------------------------------------------

Date: Tue, 21 Jan 2003 19:54:55 -0500
Message-ID:
MIME-Version: 1.0
Content-Type: multipart/mixed;
boundary="----=_NextPart_000_0000_01C2C186.F8180F60"
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0)
Importance: Normal
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C2C186.F8180F60
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

Files pertaining to Claim #: NJ-CR000245 are attached.
------=_NextPart_000_0000_01C2C186.F8180F60
Content-Type: text/plain;
name="NJ-CR000245.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="NJ-CR000245.txt"

[SNIP]
Next
Reply
Map
View

Click here to load this message in the networking platform