GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - PandaWood/Simple-MAPI.NET: A .NET wrapper around Simple MAPI - a set of functions to create an email using a compatible Email client on Windows

BranchesTags
Open more actions menu

Latest commit

 

History

45 Commits
45 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
src
src
 
 
.editorconfig
.editorconfig
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
RELEASING.md
RELEASING.md
 
 
Simple-Mapi.sln
Simple-Mapi.sln
 
 

Repository files navigation

Simple-MAPI.NET

This project originated from the Simple-MAPI-NET article on CodeProject site. There has been a few important fixes in this project since the original was imported.

The nuget package

NuGet

PM> Install-Package Simple-MAPI.NET

What does it do?

Simple MAPI.NET allows you to create an email message using the user's default email client on Windows.

You can set a subject, body and attachments and invoke the default email client (eg Outlook/Windows Mail), ready to send.

It's useful if you want to create an email for the user, without sending it yourself using SMTP etc.

Should I use

Simple MAPI is an old technology and it's basically deprecated - Microsoft warns that the use of Simple MAPI is discouraged and that it may be unavailable in later versions of Windows

But it's the only way, I know, to invoke the default Email client and set subject/body and attachments on Windows without using interops or anything Office-specific. Simple MAPI is just a set of functions and related data structures, in Windows, that this library calls.

It still works on Windows 10, with Outlook as the email client.

How to use

I have used it, with success, like this:

using Win32Mapi;

.
var mapi = new SimpleMapi();
mapi.AddRecipient(name: "[email protected]", addr: null, cc: false);
mapi.Attach(filepath: "c:\\bob.txt");
mapi.Send(subject: "a subject", noteText: "a body text");

I don't use Logon/off() because it used to cause issues (only in 64-bit Office/Outlook) and showed a superflous error but sent anyway - but I may need to revisit that choice.

Building

dotnet build src/Mapi/SimpleMapi.SDK.csproj

Cutting a release is described in RELEASING.md.

History

I was using this source code within the ExceptionReporter.NET project.

I copied it, with internal attribution, from the article on Simple-MAPI-NET on the Code Project site. But I noticed that no one else had committed this code a to a repository... so, me to the rescue.

This way, I could use the library as a dependency rather than horde a load of unrelated code in the project - and get fixes and suggestions from the community!

About

A .NET wrapper around Simple MAPI - a set of functions to create an email using a compatible Email client on Windows

Topics

emailmapisimplemapi

Resources

Readme
MIT license
Activity

Stars

27 stars

Watchers

6 watching

Forks

14 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.