L
Lloyd Dupont
At some stage I want to open the user's email client.
I do the following
string dst = "(e-mail address removed)";
string subject = "[Important]";
string body = @"some
multiline
content";
string eMailLink = "mailto:"+dst+"?subject"+subject+"&body="+body;
PropcessStart psi = new ProcessStartInfo();
psi.UseShellExecute = true;
psi.FileName = eMailLink;
Process.Start(psi);
This works fine except I don't get the line return ('\n') in the mail, so I
tried:
body = HttpUtility.UrlEncode(body);
or
body = body.Replace("\r\n", %A0");
In both cases when I call Process.Start(psi); I get
System.ComponentModel.Win32Exception was unhandled
Message="Access is denied"
Source="System"
ErrorCode=-2147467259
NativeErrorCode=5
StackTrace:
at
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at NovaMind.GUI.Dialogs.ExceptionBox.ShowException(Exception ex) in
C:\Lloyd-Dev\MacNetBridge-v1\NovaMindViewer\NovaMind.GUI\Dialogs\ExceptionBox.cs:line
31
Any ideas?
I do the following
string dst = "(e-mail address removed)";
string subject = "[Important]";
string body = @"some
multiline
content";
string eMailLink = "mailto:"+dst+"?subject"+subject+"&body="+body;
PropcessStart psi = new ProcessStartInfo();
psi.UseShellExecute = true;
psi.FileName = eMailLink;
Process.Start(psi);
This works fine except I don't get the line return ('\n') in the mail, so I
tried:
body = HttpUtility.UrlEncode(body);
or
body = body.Replace("\r\n", %A0");
In both cases when I call Process.Start(psi); I get
System.ComponentModel.Win32Exception was unhandled
Message="Access is denied"
Source="System"
ErrorCode=-2147467259
NativeErrorCode=5
StackTrace:
at
System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo
startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at NovaMind.GUI.Dialogs.ExceptionBox.ShowException(Exception ex) in
C:\Lloyd-Dev\MacNetBridge-v1\NovaMindViewer\NovaMind.GUI\Dialogs\ExceptionBox.cs:line
31
Any ideas?