Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAPI - Sending Attachments to Recipients Programmaticall
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00261254
Message ID:
00261430
Vues:
28
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
Fil
Voir

Click here to load this message in the networking platform