Process.Start & MailTo

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my Windows Form application I'm using the attached code, to launch the default email client. When the value of the FileName property exceeds 2001 characters, a Win32Exception is thrown with the message "The System cannot find the file specified". We're likely to have cases where the message will exceed 2001 characters. We've also tried SMTP (SmtpMail.Send(mmMailMsg)) and it works fine with the same message. Any suggestions

Public Sub SendEMail(
Tr
Dim strMsg As String = "A very long msg.
Dim psi As New System.Diagnostics.ProcessStartInf
psi.FileName = "mailto:[email protected]?subject=Hello&Body=" & strMs
psi.UseShellExecute = Tru
System.Diagnostics.Process.Start(psi
Catch excGeneric As Exceptio
MessageBox.Show("Exception in Sub SendEMail: " & excGeneric.ToString
End Tr
End Su

Thanks
Norm Dott
(e-mail address removed)
 
In my Windows Form application I'm using the attached code, to launch the
default email client. When the value of the FileName property exceeds 2001
characters, a Win32Exception is thrown with the message "The System cannot
find the file specified". We're likely to have cases where the message will
exceed 2001 characters. We've also tried SMTP (SmtpMail.Send(mmMailMsg)) and
it works fine with the same message. Any suggestions?
Public Sub SendEMail()
Try
Dim strMsg As String = "A very long msg."
Dim psi As New System.Diagnostics.ProcessStartInfo
psi.FileName =
"mailto:[email protected]?subject=Hello&Body=" & strMsg
psi.UseShellExecute = True
System.Diagnostics.Process.Start(psi)
Catch excGeneric As Exception
MessageBox.Show("Exception in Sub SendEMail: " & excGeneric.ToString)
End Try
End Sub

Thanks,
Norm Dotti

mailto:.... uses an Internet Explorer "mailto" protocol in which the
supplied parameters are handled as urls. the length of an url, however,
cannot exceed the 2kb limit.

regards, Wiktor
 
Back
Top