W
Wayne Wengert
I am trying to open Outlook (when it is the default mail client) from a
VB.NET application and passing a string with the "To" addresses and the
subject. (see code below) It appears that when the string is more than about
250 chars, I get an error about a null object. I need a way to pass lists of
about 250 email addresses. Does anyone know how to accomplish this?
Wayne
================ Code =====================
Public Sub StartDefaultMail( _
ByVal [To] As String, _
Optional ByVal Subject As String = "" _
)
Try
Dim psi As New ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = _
"mailto:" & System.Web.HttpUtility.UrlEncode([To]) & _
"?subject=" & Subject
Process.Start(psi)
Catch ex As Exception
MsgBox("Exception: " & ex.ToString, MsgBoxStyle.Information, "Error")
Throw _
New Exception( _
"Default mail client could not be started.", _
ex _
)
End Try
End Sub
VB.NET application and passing a string with the "To" addresses and the
subject. (see code below) It appears that when the string is more than about
250 chars, I get an error about a null object. I need a way to pass lists of
about 250 email addresses. Does anyone know how to accomplish this?
Wayne
================ Code =====================
Public Sub StartDefaultMail( _
ByVal [To] As String, _
Optional ByVal Subject As String = "" _
)
Try
Dim psi As New ProcessStartInfo
psi.UseShellExecute = True
psi.FileName = _
"mailto:" & System.Web.HttpUtility.UrlEncode([To]) & _
"?subject=" & Subject
Process.Start(psi)
Catch ex As Exception
MsgBox("Exception: " & ex.ToString, MsgBoxStyle.Information, "Error")
Throw _
New Exception( _
"Default mail client could not be started.", _
ex _
)
End Try
End Sub