How to open a new-email window in default email client with filled unicode content and attachments?

StackOverflow https://stackoverflow.com/questions/21904547

Question

How to open a new-email window in default email client with filled Unicode content and attachments?

  • If I use mailto, it doesn't support attachments.
  • If I use System.Net.Mail, it doesn't open a new-email window
  • If I use MAPI, it does't support unicode. And I can't seem to use MAPISendMailHelper or MAPISendMailW in C#.

Am I missing something?

No correct solution

OTHER TIPS

MAPI doesn't support Unicode, but you can get round that in the interop code can't you?

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
public class MapiMessage
{
    public int reserved; public string subject; public string noteText;
    public string messageType; public string dateReceived; public string conversationID; 
    public int flags; public IntPtr originator; public int recipCount; public IntPtr recips;
    public int fileCount; public IntPtr files;
}

[DllImport("MAPI32.DLL", CharSet = CharSet.Ansi)]

I've been using the following as a starting point: https://stackoverflow.com/a/4195551/1720293

I think you can still use MAPI32.dll in your c# code.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top