Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 145
  • Last Modified:

opening default email application

Hi,

I'm creating a VB application which must allow the user to email the system administrator.

Can anyone please tell me how I can create a button that will invoke the default email application??

Any suggestions or help would be greatly appreciated!
cheers,
shovels
0
shovels
Asked:
shovels
1 Solution
 
GordonpCommented:
you can use ShellExecute to launch an email client using the "mailto:" protocol

ie.

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

then to launch the client


ShellExecute Me.hwnd, "open", "mailto:anyone@home.com", vbNullString, vbNullString, 0


Hope this helps

Gordon
0
 
sljbaqgaCommented:
use MAPI Session and MAPI Message components.To use these the user should have a MAPI compatible mail client.(most of them are)

for more details refer to MSDN
search for
e-mail, composing and managing messages

hope this would be usefull
regards
Prasad

ps. there is a sample app. in MSDN samples called VBMail

other than this i think you could use a hyperlink to execute a mailto: link
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now