Question

Is it possible to attach a file with a unicode filename to an email when using MAPI?

The documentation says that MAPISendMailW is available only starting with Win8, which makes it pretty much useless for me. The docs say to use MAPISendMailHelper on Win7 and earlier, but the docs for MAPISendMailHelper say that it will convert the unicode information to ANSI if MAPISendMailW is not available.

I've started to suspect it might not be possible at all, but I'm asking anyway just in case.

Was it helpful?

Solution

It's not possible for simple MAPI, MAPISendMailHelper merely calls MAPISendMail when MAPISendMailW is not available, and MAPISendMail doesn't support Unicode.

With extended MAPI (simply called "MAPI" by Microsoft, samples included), it's possible, but extended MAPI will make your code significantly more complicated, and is for practical purposes limited to Outlook/Exchange.

OTHER TIPS

The possibility to attach a file with a Unicode filename to an email when using MAPI depends on the implementation of a particular Simple MAPI handler (DLL) which comes with each email client that can register itself as a Simple MAPI Handlers. Most modern email clients, like The Bat!, implement MAPISendMailW.

If an email client implements MAPISendMailW, it will be possible to attach a file with a Unicode filename. If it doesn't implement MAPISendMailW, then you will be unable to send a file with Unicode file name that contains characters outside your default Windows Codgepage, and even MAPISendMailHelper won't help: for example, if you have "German" language set up for non-Unicode programs in your Windows settings, and you file name contains Greek characters, these characters will be lost and changed to question marks.

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