Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP, Outlook and Redemption
Message
De
30/10/2002 09:42:27
Alan Harris-Reid
Baseline Data Services
Devon, Royaume Uni
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Titre:
VFP, Outlook and Redemption
Divers
Thread ID:
00716850
Message ID:
00716850
Vues:
52
I am currently sending emails from Visual Foxpro via. Outlook and OLE automation. Because I am using XP I am getting the (in)famous error message "A program is trying to automatically send e-mail on your behalf. Do you want to allow this?..." To get around this I have installed Redemption.

Using the code below, I am no longer getting the nuisance error messages, emails are being sent and received, but they are blank - the subject is there, but no message!

If anyone could point-out where I have gone wrong in the code below I would be grateful.

* -----------------------------------
LOCAL oOutLook, oItem, oSafeItem, oNameSpace

oOutlook = CREATEOBJECT('Outlook.Application') && open outlook
oSafeItem = CREATEOBJECT('Redemption.SafeMailItem') && open redemption

* Do I really need the following 2 lines?
oNameSpace = oOutLook.GetNameSpace('MAPI')
oNameSpace.Logon

SELECT MyTable

SCAN
oItem = oOutlook.createitem(0) && create new mail message
oSafeItem.Item = oItem && create safe item object

WITH oSafeItem
.Recipients.Add("emailaddress")
&& should I use .To="emailaddress" instead?
.Recipients.ResolveAll && only necessary if using Redemption
.subject = "Order Despatch Confirmation"
.HTMLBody = lcHTMLString
.Save()
.Send()
ENDWITH
ENDSCAN
* -------------------------------------

TIA
Alan Harris-Reid
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform