Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP, Outlook and Redemption
Message
 
 
To
30/10/2002 09:42:27
Alan Harris-Reid
Baseline Data Services
Devon, United Kingdom
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00716850
Message ID:
00716905
Views:
21
ALAN,
Where can I get the Redemption ...
I have one 2K workstation generating that anoying in-famous (err) message.
I've searched for a switch - setting, but can find no reason for it.

I posted my code below your code.


>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
   oApp=CreateObject("Outlook.Application")
   NameSpace= oApp.GetNameSpace("MAPI")
   MailItem = oApp.CreateItem(0)
   With MailItem
      .Subject = "Subject of Notification!"
      .body= CHR(10)+"Today "+TTOC(DATETIME( ))+ CHR(10)+CHR(13);
              +FILETOSTR("C:\EMAILTMP\Error.Txt")+ CHR(13)
      .Recipients.Add (lcEmail)
      .Send
   EndWith
   NameSpace.Logoff
Edgar L. Bolton, B.S. B.B.A.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform