Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send email
Message
 
To
17/05/2004 23:21:48
Joel Hokanson
Services Integration Group
Bellaire, Texas, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00904788
Message ID:
00905006
Views:
10
>Can I have a hyperlink in my VFP form to call the default email program and open a new email with the to address filled in (with my specified email address)?

It's an incredibly simple thing to do actually. Do a search in VFP help on 'MAPI'. The first item I get is on a 'Send Mail Sample'. Make note of the 2 OLE objects you need.

Basically, you drop these 2 ole objects on a form - change a few properties (provide as much or as little data as you want to) - and it calls up the default MAPI mail client with your new message waiting to complete.

The buttons are invisible to the user and I don't think you need to actually set anything on them initially. A click event on an 'Email' button on one of my forms has this:

cTo = "userid@somewhere.com"
cSubject = "whatever"
cMessage = "Who cares"
With This.Parent.OLEMAPIMsg
.MsgIndex=-1
.RecipDisplayName=cTo
.MsgSubject=cSubject
.MsgNoteText=cMessage
.SessionID=This.parent.olemapisession.sessionid
.Send
Endwith

Hope this helps!
Steven D. Supinski
The American Contractor
Santa Cruz, CA 95062
Phone: (800) 333-8435 ext 4017
Email: ssupinski@theamericancontractor.com
Previous
Reply
Map
View

Click here to load this message in the networking platform