We help IT Professionals succeed at work.

Execute Mailto: ... in VB                       using RetVal = Shell( ...

jwillemssens
jwillemssens asked
on
Is there any way to execute directly the "mailto:" in Vb using shell ?

the mailto work fine in windows (START - EXECUTE ...) and I would like to make the same in my VB project (w/o adding any special libs)

Thanks,

Jean
Comment
Watch Question

Oen

Commented:
Hi !
You can use "mailto:" via Outlook or other SMTP,POP3 clients, with API function "ShellExecute" ...
other simple way to create your own POP3 client is INET.OCX
Software Tead Lead / Business Analyst / System Analyst / Data Engineer
CERTIFIED EXPERT
Commented:
Hi,

Try this:

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
Const SW_SHOWNORMAL = 1
Private Sub Form_Load()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: KPDTeam@Allapi.net
    'Send an E-Mail to the KPD-Team
    ShellExecute Me.hwnd, vbNullString, "mailto:KPDTeam@Allapi.net", vbNullString, "C:\", SW_SHOWNORMAL
End Sub

Author

Commented:
works fine - thanks for the link
Ryan ChongSoftware Tead Lead / Business Analyst / System Analyst / Data Engineer
CERTIFIED EXPERT

Commented:
Hi jwillemssens,

You're welcome, glad make help:)

Explore More ContentExplore courses, solutions, and other research materials related to this topic.