Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mailhound

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mailhound - npm Package Compare versions

Comparing version 1.0.5 to 2.0.0

2

app.json

@@ -16,4 +16,4 @@ {

"ADMIN": "name@domain.com",
"MANDRILL_API_KEY": "you_mandrill_api_key"
"SMTP": "smtp://postmaster%40domain.com:password@smtp.server.com"
}
}
{
"MANDRILL_API_KEY": "your_api_key"
"SMTP": "smtp://postmaster%40domain.com:password@smtp.server.com"
}
{
"name": "mailhound",
"version": "1.0.5",
"version": "2.0.0",
"description": "Mailhound is a simple server side script for receiving form posts and emailing the form values.",

@@ -28,4 +28,4 @@ "keywords": [

"express": "^4.11.1",
"mandrill-api": "^1.0.41",
"nconf": "^0.7.1"
"nconf": "^0.7.1",
"nodemailer": "^2.3.2"
},

@@ -32,0 +32,0 @@ "devDependencies": {

@@ -9,3 +9,3 @@ # mailhound

1. Create an account at [Mandrill](https://mandrill.com) and make note of your api key
1. Create an account with a mail provider like [Mailgun](https://mailgun.com) or [Sendgrid](https://sendgrid.com)

@@ -20,3 +20,3 @@ ### Heroku Install (Free)

1. **ADMIN**: Enter your email
2. **MANDRILL_API_KEY**: Paste in your api key
2. **SMTP**: Your smtp credentials
4. Deploy for **Free**!

@@ -30,3 +30,3 @@

4. Add config variable exports to the end of your `~/.profile` file
1. `export MANDRILL_API_KEY=your_api_key`
1. `export SMTP=smtp://postmaster:pass@smtp.server.com`
2. `export KEY:name@domain.com`

@@ -33,0 +33,0 @@ 5. Reconnect to SSH and run the script `mailhound`

@@ -5,3 +5,3 @@ #!/usr/bin/env node

var bodyParser = require('body-parser');
var mandrill = require('mandrill-api/mandrill');
var nodemailer = require('nodemailer');
var nconf = require('nconf');

@@ -15,3 +15,3 @@

var mandrill_client = new mandrill.Mandrill(config.get('MANDRILL_API_KEY'));
var transport = nodemailer.createTransport(config.get('SMTP'));
var app = express();

@@ -66,33 +66,22 @@

// Create an email message based on post values
var message = {
var mailOpts = {
'text': emailMessage || 'No message was provided',
'subject': req.body._subject || 'Email from mailhound',
'from_email': req.body._replyto || req.body.email,
'from_name': req.body.name,
'to': [
{
'email': config.get(req.query.key),
'type': 'to'
},
{
'email': req.body._cc,
'type': 'cc'
}
]
'from': {
'name': req.body.name,
'address': req.body._replyto || req.body.email
},
'to': config.get(req.query.key),
'cc': req.body._cc
}
// Send the message!
mandrill_client.messages.send(
{
'message': message,
'async': false
},
function(result) {
res.redirect(req.body._next || req.get('Referrer'));
},
function(e) {
console.log('Error sending email: ' + e.name + ' - ' + e.message);
res.status(500).send({ error: 'Error sending email' });
}
);
transport.sendMail(mailOpts, function(err, info) {
if (err) {
console.log('Error sending email: ' + err.name + ' - ' + err.message);
return res.status(500).send({ error: 'Error sending email' });
}
res.redirect(req.body._next || req.get('Referrer'));
});
});

@@ -99,0 +88,0 @@

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