?
Solved

How to determine the default email program

Posted on 2002-06-20
7
Medium Priority
?
159 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 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…
Suggested Courses
Course of the Month14 days, 10 hours left to enroll

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