Skip to content
/ Postie Public

A VS Code extension for local email testing with an integrated SMTP server, offering email capture, preview, and configuration options for developers.

License

Notifications You must be signed in to change notification settings

reconka/Postie

Repository files navigation

Postie Logo

Postie: Development Email SMTP Server for VS Code

code style: prettier VS Code Version TypeScript Version jest VS Code Marketplace ESLint Version CI Codacy Badge

Postie is a Visual Studio Code extension that provides a development email SMTP server using Nodemailer smtp-server. It allows developers to catch and inspect emails sent by their applications during development, all within the VS Code environment.

Note: This extension is designed for development purposes only. Do not use it in production environments.

Features

  • Integrated SMTP server using Nodemailer smtp-server
  • Export emails as .eml files
  • Open email source in your editor
  • HTML content preview with responsive design modes (Mobile/Tablet/Desktop)

Installation

  1. Open VS Code
  2. Go to the Extensions view (Ctrl+Shift+X)
  3. Search for "Postie"
  4. Click Install

Alternatively, run the following command in VS Code's quick open (Ctrl+P):

ext install Postie.postie

Usage

  1. Start the Postie SMTP server by clicking the Postie icon in the Activity Bar.
  2. Configure your application to send emails to localhost on the port specified in the Postie config.
  3. View incoming emails in the Postie section located in the sidebar

Postie Welcome screen

Postie will store emails in your vscode until you delete them. You can export emails as .eml files or open the email source in your editor.

When previewing email content, links can be opened in your default web browser by clicking on them with Cmd (on macOS) or Ctrl (on Windows).

For more information, see the Postie Integration Guide.

Configuration

To customize Postie for your development environment, you can adjust the following settings in your VS Code settings.json file:

  • postie.smtpServerPort: The port number for the SMTP server. Default is 587.
  • postie.smtpUsername: Username for SMTP server authentication. Default is "postie".
  • postie.smtpPassword: Password for SMTP server authentication. Default is "postie".
  • postie.maxStoredEmailsCount: The maximum number of emails Postie will store before older emails are deleted. Default is 100.
  • postie.maxEmailSize: Maximum size of an email in bytes. The default is 1048576 (1MB).
  • postie.showNewEmailNotification: Set to true to show a notification when a new email arrives. Default is true.
  • postie.runServerOnStartup: Set to true to automatically start the SMTP server when VS Code starts. Default is true.
  • postie.allowExternalMails: Set to true to allow receiving emails from external sources. This is useful for testing emails sent from external sources. Default is false.

You can modify these settings to fit your needs. For example, to change the SMTP server port and the maximum email size, add the following lines to your settings.json:

{
  "postie.smtpServerPort": 587,
  "postie.maxEmailSize": 2097152
}

Gotchas

  • Outlook not rendering EML files correctly on Windows: CR LF EML Export Issue: If you encounter issues with CR LF line endings in EML exports, use the "Change File Encoding" feature in Visual Studio Code. You can find this option at the bottom of the VS Code window. Change the encoding to "Windows (CRLF)" to fix the issue.

Contributing

We welcome contributions to Postie! Please check out our contributing guidelines for more information on how to get started.

Development Setup

To set up a development environment for contributing to the Postie extension, follow these steps:

  1. Clone the Repository

    First, clone the repository to your local machine using Git:

  2. Install Dependencies

    Navigate to the cloned directory and install the necessary dependencies using npm:

    npm install
  3. Open in VS Code

    Open the cloned Postie directory in Visual Studio Code:

    code .
  4. Run the Extension in Development Mode

    In VS Code, press F5 to open a new VS Code window with the Postie extension running in development mode. This allows you to test your changes in a real-world scenario.

  5. Making Changes

    Make your desired changes to the code. You can debug the extension by setting breakpoints in the VS Code editor.

  6. Submit a Pull Request

    Once you're satisfied with your changes, commit your changes, push them to your fork, and submit a pull request to the main Postie repository.

License

This project is licensed under the MIT License.

About

A VS Code extension for local email testing with an integrated SMTP server, offering email capture, preview, and configuration options for developers.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •