Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 31st, 2005, 6:28 AM   #1
bigbondfan
Newbie
 
bigbondfan's Avatar
 
Join Date: May 2005
Posts: 7
Rep Power: 0 bigbondfan is on a distinguished road
Lightbulb [solved] email link in VB6

I want to make a simple Email link (like a mailto link in HTML) in vb6 that will open a new message in the default mail client with the email address and subject

Last edited by bigbondfan; Jun 1st, 2005 at 7:52 AM. Reason: solved
bigbondfan is offline   Reply With Quote
Old May 31st, 2005, 12:09 PM   #2
Rory
Expert Programmer
 
Rory's Avatar
 
Join Date: Jan 2005
Location: London
Posts: 542
Rep Power: 4 Rory is on a distinguished road
Send a message via MSN to Rory
Do you mean a button/label on a form? If so, you can activate mailto links using the normal shell api (the run command):
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
    ShellExecute Me.hwnd, vbNullString, "mailto:bill@microsoft.com?subject=Your software sucks", vbNullString, "%SystemRoot%", SW_SHOWNORMAL
End Sub
This works as the mail client sets itself up as the mailto device handler. Thus, the directory is arbitrary so %SystemRoot% (C:\Windows\) was passed. As it is a not an exectutable, the handle and show style parameters are probably irrelevant anyway.
Rory is offline   Reply With Quote
Old Jun 1st, 2005, 7:51 AM   #3
bigbondfan
Newbie
 
bigbondfan's Avatar
 
Join Date: May 2005
Posts: 7
Rep Power: 0 bigbondfan is on a distinguished road
Thanks very much
bigbondfan is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 8:17 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC