Click here to Skip to main content
15,868,141 members
Articles / Programming Languages / C#
Tip/Trick

Notepad++ Email Plugin

Rate me:
Please Sign up or sign in to vote.
5.00/5 (5 votes)
27 Jan 2016CPOL2 min read 49.3K   23   5
Email Plugin for Notepad++ in C#

Introduction

Today, most of us use Notepad++ (based on Scintilla) as our general purpose editor. Notepad++ provides a way to inject your own plugins. Just create your plugin and put its DLL file to the right location and you are done. Here is an example of writing plugin(s) for Notepad++ using your favorite language C#.

Background

The example plugin is a simple email plugin, that will allow the user to email current file's contents as email attachment. It allows the user to set mail server configuration and send emails using GUI injected by the plugin.

Email settings are stored in a text (.INI) file but password(s) are stored in encrypted format to provide a security layer for your credentials.

Using the Code

The source code is organized in a directory structure that is self-explanatory. Below is a short description of how directory structure organizes the code.

  • Core/Npp - Contains classes to send commands to Notepad++
  • Core/Scintilla - Contains classes that wraps scintilla types
  • Core/Platform - Contains class(es) for DLL Imports
  • DllExports - Contains class(es) for exported functions called by Notepad++ plugin system
  • Forms - Contains Windows forms for GUI

The PluginUI class contains the functions required for UI Registration with Notepad++. PluginExports class is responsible to export the functions called by Notepad++. Please go through the below link to understand how Notepad++ plugin system works.

To deploy the plugin, compile the project and copy the DLL file to {Notepad++ Installation Folder}}\plugins folder or you can use Notepad menu Settings>>Import>>Import plugins for the same. Once the plugin is deployed, start Notepad++ and you will see the your plugin icon(s) on Notepad++ toolbar. You can also find your plugin under Plugins menu.

Below are screenshots of installed plugin:

Image 1

Image 2

Image 3

History

  • 27th January, 2016: First version

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Admiral Technologies
India India
I love working on new technologies. Mostly I work on Microsoft technologies and Micro-controller programming.

Comments and Discussions

 
QuestionWill not build Pin
trantrum9-Mar-17 9:06
professionaltrantrum9-Mar-17 9:06 
QuestionRAR Pin
Doug Ewell28-Jan-16 10:08
Doug Ewell28-Jan-16 10:08 
AnswerRe: RAR Pin
Manoj Kumar Chaudhari28-Jan-16 19:24
Manoj Kumar Chaudhari28-Jan-16 19:24 
QuestionGood but... Pin
Rahman Mahmoodi27-Jan-16 9:54
Rahman Mahmoodi27-Jan-16 9:54 
AnswerRe: Good but... Pin
Manoj Kumar Chaudhari27-Jan-16 22:03
Manoj Kumar Chaudhari27-Jan-16 22:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.