General information
Category:
COM/DCOM and OLE Automation
Title:
Attachments in Outlook from VFP
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only