3

I would like to open the default E-Mail client and create an E-Mail for the user. The user then should just have to send it.

So far I use this code:

StringBuilder sb = new StringBuilder(lblLink.Text);
sb.Append("?subject=");
sb.Append(mProduct);
sb.Append("&body=");
sb.Append(Properties.Strings.MailBody);
sb.Append(GetFullText());

// Use Unicode newlines
string mailText = sb.ToString();
mailText = mailText.Replace("\r\n", "%0d");

// Open E-Mail Editor
aMailApp.StartInfo.FileName = mailText;
aMailApp.StartInfo.UseShellExecute = true;
aMailApp.StartInfo.RedirectStandardOutput = false;
aMailApp.Start();

The problem with this approach is that the E-Mails body gets truncated after ~2000 characters. Is there any way to fix this?

Thanks!

Boris
  • 8,551
  • 25
  • 67
  • 120

1 Answers1

1

If you are working in a MS Windows environment only you can maybe avoid this restriction by using the MAPI32.DLL.

Have a look at my previous post "How to send email using default email client?"

Community
  • 1
  • 1
Alex
  • 755
  • 1
  • 7
  • 12