Solved

How to determine the default email program

Posted on 2002-06-20
7
141 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
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 69

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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 69

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 69

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
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…

707 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now