How to open outlook express in VB.NET

M

Mamatha

Hi

If we displayed some Emails in a listbox then i have to
open that email addresses with outlook express,how can i
open in VB.NET,if u know any clues or code for that please
let me know, thanks in advance.



Mamatha
 
C

Cor Ligthert

Mamatha,

For every default mail client, and this is the max that is possible, watch
as well the subject and the message, for some it needs to have UrlEncode
(sMessage) and for others not.

I hope this helps?

Cor

\\\by Fergus Cooney and small correction Cor
'A reference to System.Web may be necessary
'in the Project for this Import to work.
Imports System.Web.HttpUtility

Public Sub StartDefaultMail (sTo As String, _
Optional sSubject As String = "", _
Optional sMessage As String = "")
Try
sTo = UrlEncode (sTo)
sSubject = sSubject
sMessage = sMessage
Process.Start ("mailto:" & sTo & "?subject=" _
& sSubject & "&body=" & sMessage)

Catch e As Exception
MsgBox ("Couldn't start default email application" _
& vbCrLf & e.Message)
'or
Throw New Exception ("Couldn't start default email app", e)
End Try
End Sub
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top