Information générale
Catégorie:
Fonctions Windows API
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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement