Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Email with Attachment without using Outlook
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00923038
Message ID:
00980160
Views:
56
I don't think it will work with outlook. With CDO you communicate directly through the SMTP protocol to bounce an e-mail off to a destination. For Outlook, I would look at creating a connection to Outlook which will allow you to manipulate any part of Outlook. Outlook 2003 I noticed prompts about activity and verifies that the activity is to be done on your behalf.

Below is an example of using Outlook. It has a form that asks for the To, Subject and Body. The attachment was created before the form was called and had it passed to it.

oOutlookObject = CREATEOBJECT("Outlook.Application")
oEMailItem = oOutlookObject.CreateItem(0)
WITH oEMailItem
.To = THISFORM.txtTo.VALUE
.Subject = THISFORM.txtSubject.VALUE
.Body = THISFORM.edtMessage.VALUE + CHR(13) + CHR(13)
IF THISFORM.txtNumAttachments.VALUE > 0
.Attachments.Add(THISFORM.Attachment1)
ENDIF
.Send
ENDWITH
RELEASE oEMailItem
RELEASE oOutlookObject

Microsoft has information with OLE (old term). A lot of the information is for VB, but not too bad on translating it to VFP.

Thanks,

Warren Murphey
Previous
Reply
Map
View

Click here to load this message in the networking platform