Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to send email in VFP using Outlook ?
Message
From
04/02/2003 11:59:30
 
 
To
04/02/2003 11:45:09
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00748908
Message ID:
00748920
Views:
35
This message has been marked as the solution to the initial question of the thread.
You can use office automation. Here is a sample code:
#DEFINE MAILITEM 0
#DEFINE IMPORTANCELOW 0
#DEFINE IMPORTANCENORMAL 1
#DEFINE IMPORTANCEHIGH 2

oOutLookObject = CreateObject("Outlook.Application")
oEmailItem = oOutLookObject.CreateItem(MAILITEM)

WITH oEmailItem
.To = "myself@mymailaddress.com;someone@somewhere.com"
.Subject = "Sending Email from within Foxpro to multiple recipients and with attachments"
.Importance = IMPORTANCENORMAL
.Body = "I'm now testing sending to multiple recipients in the .To value from within my app and mulitple attachments too."
.Attachments.Add("c:\temp\myfile.txt")
.Attachments.Add("C:\temp\junk.txt")
.Send
ENDWITH

RELEASE oEmailItem
RELEASE oOutLookObject
You might want to look at redemption also.

Download “Outlook Redemption“, a DLL written by Dmitry Streblechenko. It is free for personal use and costs $199 to distribute in commercial software:

http://www.dimastr.com/redemption/download.htm

After downloading it, you can try something similar to:
*--Need path to redemption
set DEFAULT TO c:\programnotes\redemption
*--Send Email
oOutlook = GETOBJECT(, "Outlook.Application")
oMailItem = oOutlook.CreateItem(0)
oSafeMailItem = CREATEOBJECT("Redemption.SafeMailItem")
oSafeMailItem.Item = oMailItem
oSafeMailItem.Subject = "Test Email with Redemption"
oSafeMailItem.Recipients.Add("somebody@somewhere.com")
lResolved = oSafeMailItem.Recipients.ResolveAll()
lSent = oSafeMailItem.Send()
Tracy

>Is exist an OCX or any other way? Thank you in advance.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Reply
Map
View

Click here to load this message in the networking platform