How to use MAPI to change the charset of an email?

How to use MAPI to change the charset of an email?

Post by Jeffre » Sun, 23 Oct 2005 01:16:28


Greetings,

I am trying to use MAPI to send emails under Japanese OS.

However, the mail is always being sent using charset= iso-8859-1,
instead of " iso-2022-jp", I wonder when / where / how do I change
the charset before sending the email?

Thanks,
Jeffrey
 
 
 

How to use MAPI to change the charset of an email?

Post by Jeffre » Sun, 23 Oct 2005 03:36:48

This seems to work:

#ifndef PR_INTERNET_CPID

#define PR_INTERNET_CPID 0x3FDE0003

#endif

SPropValue* propValue = NULL;

::MAPIAllocateBuffer(sizeof(SPropValue), (LPVOID FAR*)&propValue);

if (NULL != propValue)

{

propValue->Value.ul = 932; // Japanese code page

propValue->ulPropTag = PR_INTERNET_CPID;

::HrSetOneProp(sMessage, propValue);

::MAPIFreeBuffer(propValue);

}

 
 
 

How to use MAPI to change the charset of an email?

Post by Dmitry Str » Tue, 25 Oct 2005 06:56:38

Don't forget to save the changes
(sMessage->SaveChanges(KEEP_OPEN_READWRITE))

Dmitry Streblechenko (MVP)
http://www.yqcomputer.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool