how to find default email client

how to find default email client and invoke corresponding app. i have outlook ,netscape,outlook express, incredimail are the email clients available in my os and need to find out the default one and send the mail through it from vb

regards




Answer this question

how to find default email client

  • RabBsl

    OK, So if you just want to send an email with the default client.

    http://www.codeproject.com/dotnet/Default_mail_client.asp

    details this but its pretty much the same as the others have specified here and using process.start

    If you want to know what the executable is for the current default email client.  This is stored in the following registry key

    [HKEY_CLASSES_ROOT\mailto\shell\open\command]

    In my case it displays

    "C:\PROGRA~1\MICROS~3\OFFICE11\OUTLOOK.EXE" -c IPM.Note /m "%1"

    Which is the outlook executable with a few command line parameters.

     

    I'm not sure what your meaning by extract from the address book as different email clients have different ways of accessing the address book.   So I'm unsure of what your trying to do.

    Sending Email to default client doesn't require you to know what the client actually is just that there is actually a default email client and then use the process start.

     


  • Les Thompson

    You have to tell it you want to mail, not just supply the address.  For example:

    Process.Start("mailto:bill@microsoft.com")

    works fine for me.


  • AaronNY

    Public 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

    sText = "mailto:" & Text1(0).Text
    sText = sText & " Subject=" & Text1(3).Text
    sText = sText & "&cc=" & Text1(1).Text
    sText = sText & "&Body=" & Text2.Text

    Call ShellExecute(Me.hWnd, vbNullString, sText, vbNullString, vbNullString, SW_SHOWNORMAL)

    i am trying to attach a file in the mailto function but i could not , i have used "attach /attachment keywords but no luck "..

    how to attach afile in the mail to function

    aravind



  • ssh022

    Thanks a lot !!!

    Seached so long for that little bit of code to start a prog.

    Ben

  • DavidTM

    Process.Start is used to run a program. I believe if you pass it an email address, it will start your default mail app.



  • JP.DEV

    i used in shellexcecute ( process.start) . still not achieved task . might be i am doing some thing wrong.

    actually i want to find which email client is default and after that i have extract address book of the email and try to send mails through the default one

    aravind



  • Macy-Mike

    no luck with process.start

    aravind



  • how to find default email client