Solved

How to determine the default email program

Posted on 2002-06-20
7
154 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
SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

 
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

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!

Question has a verified solution.

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

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
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…

726 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