New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

pixl-mail

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pixl-mail - npm Package Compare versions

Comparing version 1.0.13 to 1.0.14

4

package.json
{
"name": "pixl-mail",
"version": "1.0.13",
"version": "1.0.14",
"description": "A very simple class for sending e-mail via SMTP.",

@@ -22,3 +22,3 @@ "author": "Joseph Huckaby <jhuckaby@gmail.com>",

"dependencies": {
"nodemailer": "6.6.1",
"nodemailer": "6.9.9",
"pixl-tools": "^1.0.19",

@@ -25,0 +25,0 @@ "pixl-class": "^1.0.3"

@@ -9,3 +9,3 @@ # Overview

```
```sh
npm install pixl-mail

@@ -16,4 +16,4 @@ ```

```javascript
var PixlMail = require('pixl-mail');
```js
const PixlMail = require('pixl-mail');
```

@@ -23,6 +23,6 @@

```javascript
var mail = new PixlMail( 'smtp.myserver.com', 25 );
var mail = new PixlMail( '127.0.0.1' );
var mail = new PixlMail();
```js
let mail = new PixlMail( 'smtp.myserver.com', 25 );
let mail = new PixlMail( '127.0.0.1' );
let mail = new PixlMail();
```

@@ -32,9 +32,9 @@

```javascript
var message =
```js
let message =
"To: president@whitehouse.gov\n" +
"From: citizen@email.com\n" +
"Subject: NASA Budget\n" +
"Subject: State Budget\n" +
"\n" +
"Dear Mr. President,\nPlease give NASA back their money.\n";
"Dear Mr. President,\nOur state needs more money.\n";

@@ -50,9 +50,9 @@ mail.send( message, function(err) {

The library supports a simple e-mail templating system, where you can insert `[bracket_placeholders]` in your e-mail message, and have the library fill them with appropriate content from a separate object. This feature uses the [sub()](https://www.npmjs.com/package/pixl-tools#sub) function from the [pixl-tools](https://www.npmjs.com/package/pixl-tools) package.
The library supports a simple e-mail templating system, where you can insert `[bracket_placeholders]` in your e-mail message, and have the library fill them with appropriate content from a separate object. This feature uses the [sub()](https://github.com/jhuckaby/pixl-tools#sub) function from the [pixl-tools](https://github.com/jhuckaby/pixl-tools) package.
As an example, imagine a welcome e-mail for a new user who has signed up for your app. You have the welcome e-mail "template" stored separately, and want to fill in the user's e-mail address, full name and username at sending time. Here is how to do this:
```javascript
```js
// email template
var message =
let message =
"To: [email]\n" +

@@ -65,3 +65,3 @@ "From: support@myapp.com\n" +

// placeholder args
var user = {
let user = {
username: "jhuckaby",

@@ -88,3 +88,3 @@ full_name: "Joseph Huckaby",

You can actually use a complex hash / array tree of arguments, and then specify `[filesystem/style/paths]` or `[dot.style.paths]` in your placeholders. See the [sub()](https://www.npmjs.com/package/pixl-tools#sub) docs for details.
You can actually use a complex hash / array tree of arguments, and then specify `[filesystem/style/paths]` or `[dot.style.paths]` in your placeholders. See the [sub()](https://github.com/jhuckaby/pixl-tools#sub) docs for details.

@@ -95,4 +95,4 @@ ## Loading From Files

```javascript
var user = {
```js
let user = {
username: "jhuckaby",

@@ -112,4 +112,4 @@ full_name: "Joseph Huckaby",

```javascript
var args = {
```js
let args = {
attachments: [

@@ -132,9 +132,9 @@ { filename: "contract.pdf", path: "files/contracts/4573D.PDF" },

```javascript
var message =
```js
let message =
"To: president@whitehouse.gov\n" +
"From: citizen@email.com\n" +
"Subject: NASA Budget\n" +
"Subject: State Budget\n" +
"\n" +
"<h1>Dear Mr. President,</h1>\n<p><b>Please</b> give NASA back their <i>money</i>.</p>\n";
"<h1>Dear Mr. President,</h1>\n<p><b>Please</b> give our state more <i>money</i>.</p>\n";

@@ -154,3 +154,3 @@ mail.send( message, function(err) {

```javascript
```js
mail.setOption( 'secure', true ); // use ssl

@@ -157,0 +157,0 @@ mail.setOption( 'auth', { user: 'fsmith', pass: '12345' } );

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc