?
Solved

How to determine the default email program

Posted on 2002-06-20
11
Medium Priority
?
173 Views
Last Modified: 2010-05-02
How to determine the default Email program running in the system (i.e, Microsoft Outlook, Outlook Express) in VB.
I am developing one application and I want to include this functionality by just clicking a single Button then the program will automatically open the default Email Software.
Any help would be much appreciated. Thank you.
0
Comment
Question by:arnoldgh
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 2
  • 2
  • +1
11 Comments
 
LVL 44

Expert Comment

by:bruintje
ID: 7097816
Hi Arnoldgh,

a popular approach in this VB TA is to implement independent mail client functionality with this component

http://www.freevbcode.com/ShowCode.Asp?ID=109

HAGD:O)Bruintje
0
 

Author Comment

by:arnoldgh
ID: 7098285
Thank you Bruintje, your suggestion would be very useful for customized emailing system, but in my case, I simply just need
to run or open up the default Email Software so the user can have options to send, receive emails or manage addresses, etc. I don't want
it to automatically run the email send option.

Regards,
arnoldgh
0
 

Author Comment

by:arnoldgh
ID: 7098287
Thank you Bruintje, your suggestion would be very useful for customized emailing system, but in my case, I simply just need
to run or open up the default Email Software so the user can have options to send, receive emails or manage addresses, etc. I don't want
it to automatically run the email send option.

Regards,
arnoldgh
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7098336
Use "mailto:"

' Form1
Option Explicit
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

Private Sub Form_Click()
  Dim ret As Long, mailInfo(0 To 4) As String
  mailInfo(0) = "aaa@aaa"
  mailInfo(3) = "Report for %D"
  mailInfo(4) = "Hi, I'm sending report for %D.  Regards, "

  ' open 'new message' in OE
  ret = ShellExecute(Me.hwnd, vbNullString, _
      "mailto:" & mailInfo(0) _
      & "?CC=" & mailInfo(1) _
      & "&BCC=" & mailInfo(2) _
      & "&Subject=" & Replace(mailInfo(3), "%D", Format(Date, "dd.mm.yyyy") & _
          " (" & WeekdayName(Weekday(Date, vbMonday), , vbMonday) & ")") _
      & "&Body=" & Replace(mailInfo(4), "%D", Format(Date, "dd.mm.yyyy") & _
          " (" & WeekdayName(Weekday(Date, vbMonday), , vbMonday) & ")") _
      , vbNullString, "c:\", 1)
0
 

Author Comment

by:arnoldgh
ID: 7102673
Hi emoreau,
    Thank you for your suggestion, but, is there a way that I will be able to detect the default email program (say in the windows registry) so that I can execute it (as if I'm just clicking on the program Icon on the Start Menu to open it up). I simply want to open the default email software and not automatically sending a mail.

Thanks and regards,
arnoldgh
0
 
LVL 44

Expert Comment

by:bruintje
ID: 7102689
Hi Aronldgh, you can also look at this snippet

http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=969&lngWId=-10

HAGD:O)Bruintje
0
 

Author Comment

by:arnoldgh
ID: 7102718
Hi emoreau,
    Thank you for your suggestion, but, is there a way that I will be able to detect the default email program (say in the windows registry) so that I can execute it (as if I'm just clicking on the program Icon on the Start Menu to open it up). I simply want to open the default email software and not automatically sending a mail.

Thanks and regards,
arnoldgh
0
 
LVL 1

Accepted Solution

by:
tetrode earned 300 total points
ID: 7103785
see HKEY_CLASSES_ROOT\mailto\shell\open\command
0
 

Author Comment

by:arnoldgh
ID: 7104073
I would like to thank bruintje and emoreau for your effort and suggestions, however I would like to give the points to tetrode as his suggestion was actually what I'm looking at. Thank you very much guys.

Regards,
arnoldgh
0
 
LVL 1

Expert Comment

by:tetrode
ID: 7110034
Thanks! - BTW you will need to do some parsing there - be sure that you cover all possibilities.

Mark
0
 

Author Comment

by:arnoldgh
ID: 7112714
understand, yes I will. Thanks.
0

Featured Post

Introducing Priority Question

Increase expert visibility of your issues by participating in Priority Question, our latest feature for Premium and Team Account holders. Adjust the priority of your question to get emergent issues in front of subject-matter experts for help when you need it most.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question