Solved

How to determine the default email program

Posted on 2002-06-20
7
150 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
7 Comments
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7097779
You could use shellexecute api with Mailto. It will opens your default email program.
There is another way that doesn't take cares of which one you use:
http://www.freevbcode.com/ShowCode.Asp?ID=109
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7098335
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
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7169812
Hi, any progress here? Need more help?
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7348097
This question appears to be abandoned. A question regarding it will be left in the CleanUp
area; if you have any comment about the question, please leave it here.

Unless there is objection or further activity, one of the moderators will be asked to split points between <emoreau> and <Richie_Simonetti>.

DO NOT ACCEPT THIS COMMENT AS AN ANSWER.
0
 

Author Comment

by:arnoldgh
ID: 7348735
Hi Richie and Emoreau,
    First of all, I would like to apologize for this questionaire because I think I made two instances of the same question of the same date. Actually, this question has already got an answer and I had already accepted it since 24th of June, 2002. The accepted answer came from "
Tetrode" and here is it:
 "see HKEY_CLASSES_ROOT\mailto\shell\open\command.
I would like to request the moderator to please ignore this question and put it in the CleanUp area. Once again, to Richie and Emoreau, sorry guys for the inconvenience and thank you.

Regards,
Arnold
0
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7349346
In this case, you need to ask yourself for a delete in the Community Support area.
0
 
LVL 5

Accepted Solution

by:
Netminder earned 0 total points
ID: 7358563
Points refunded and question closed.

Netminder
CS Moderator
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

734 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