简体   繁体   中英

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

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM