MapiEx
Clone from the CodeProject
Install / Use
/learn @luuksommers/MapiExREADME
Extended Mapi for C#
Original code by Noel Dillabough
http://www.codeproject.com/Articles/10881/MAPIEx-Extended-MAPI-Wrapper
Usage
if (NetMAPI.Init())
{
NetMAPI mapi = new NetMAPI();
if (mapi.Login())
{
if (mapi.OpenMessageStore())
{
if (mapi.OpenInbox() && mapi.GetContents())
{
mapi.SetUnreadOnly(false);
MAPIMessage message;
StringBuilder s = new StringBuilder(NetMAPI.DefaultBufferSize);
while (mapi.GetNextMessage(out message))
{
Console.Write("Message from '");
message.GetSenderName(s);
Console.Write(s.ToString() + "' (");
message.GetSenderEmail(s);
Console.Write(s.ToString() + "), subject '");
message.GetSubject(s);
Console.Write(s.ToString() + "', received: ");
message.GetReceivedTime(s);
Console.Write(s.ToString() + "\n\n");
// use message.GetBody(), message.GetHTML(), or message.GetRTF() to get the text body
// GetBody() can autodetect the source
string strBody;
message.GetBody(out strBody, true);
Console.Write(strBody + "\n");
message.Dispose();
}
}
}
mapi.Logout();
}
NetMAPI.Term();
}
Setup
- Visual Studio 2010 Professional or higher for MFC headers
- When using VS2013, download Visual Studio 2013 C++ Multi Byte Support
- When using VS2012/VS2013, VS2010 must also be installed to support the platform toolset v100 (C++ 2010 redistributable)
Deployment
This library uses the Visual C++ 2010 redistributable
FAQ
Does this support x64 MAPI
No, MAPI only supports x64 when an x64 office is installed. See Building MAPI Applications on 32-Bit and 64-Bit Platforms. Not many people do have this installed. On request I can try to build one.
Why Multibyte, isn't it deprecated for MFC?
MAPI only supports unicode for a couple of functions. See MAPI Character Sets
Related Skills
node-connect
354.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
112.2kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
354.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
354.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
