Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Email with VFP
Message
From
11/11/2003 12:02:50
Dave Nantais
Light speed database solutions
Ontario, Canada
 
 
To
10/11/2003 15:54:48
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00848483
Message ID:
00848765
Views:
25
>I'm trying to send email through a VFP form. I have a form where I can pick receivers from a combo box, type in a subject and a message body. I have a send button on my form. I use the following code, but the message just sits in my drafts folder. I'm using Outlook 2002.
>
>LOCAL oRedem, oOutlook, oMail
>oRedem = CREATEOBJECT("Redemption.SafeMailItem")
>oOutlook = CREATEOBJECT("Outlook.Application")
>oMail = oOutlook.CreateItem(0)
>oRedem.ITEM = oMail
>oRedem.TO = ("lurso@csiu.org")
>oRedem.subject = THISFORM.subject.VALUE
>oRedem.Body = THISFORM.r_mmessage
>oRedem.SEND
>Utils = CreateObject("Redemption.MAPIUtils")
>Utils.DeliverNow
>
>The last 2 lines of code are supposed to flush the message queues, but this does not happen. If I go into Outlook and click the Send/Receive button, still the message sits in the Drafts folder.
>
>I'm really looking for any kind of help/suggestions/ideas on what I could try and do. Thanks in advance.

Messages should remain in the DRAFTS folder. Messages are not SENT from the DRAFTS folder. You should place messages in the OUTBOX. When you click on `SEND/RECEIVE` messages from the OUTBOX are sent to their appropriate destinations.

First get OUTLOOK2002 working with messages in your OUTBOX being sent via the manual 'send/receive' command button. Then, try doing it with VFP Code. But, place the email messages in the OUTBOX.

Furthermore, from your description of your problem you do not need Outlook2002 to perform this task. Why not just use MAPI, that is the MSMAPI32.OCX control? The sample code provided with VFP 6,7, or 8 shows you how to send email.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform