General information
Category:
Windows API functions
Chuck,
I used the following code to send an attachment with no problem at all.
I commented out stuff that was not required (already logged on), and the createitemfrom template can be replaced with a basic createitem.
Where my problem is is in embedding a MSGRAPH within the body of the message vice sending one as an attachment. Hence the createitemfromtemplate call --the template was a html formatted email vice the rich text format.
Anyway, try the below code to see if it does what you are looking for.
Laurin
theApp = CreateObject("Outlook.Application")
theNameSpace = theApp.GetNameSpace("MAPI")
*theNameSpace.Logon(strProfile , strPassword)
theMailItem = theApp.CreateItemFromTemplate('d:\metrics\otlk.oft')
theMailItem.Recipients.Add( mtb.bossemail ) &&field with an email address in it
theMailItem.Subject = strSubject
theMailItem.Body = strBody
MyAttachments= theMailItem.Attachments
MyAttachments.add('d:\gifs\pigs flying.gif')
theMailItem.display
theMailItem.Send
Previous
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