Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Send email and a pony.

branch: master
readme.markdown

pony

Send email and a pony.

build status

pony

example

var pony = require('pony');

var mail = pony({
    host : 'localhost',
    port : 25,
    from : 'substack',
    to : 'root',
});
mail.setHeader('content-type', 'text/plain');
mail.setHeader('subject', 'greetings');
mail.end('oh hello');

methods

var pony = require('pony')

var req = pony(params, cb)

Send an email with some parameters params.

An optional callback cb(err, req) will fire once the initial handshake is complete.

request object

The request object is a stream that behaves like the req you get from http.createServer().

SMTP messages are a lot like is HTTP messages is why.

req.setHeader(key, value)

Use setHeader() to set the 'content-type', 'subject', and such things relevant to emails.

req.removeHeader(key)

Remove a header.

req.write(data)

Write a string or Buffer to the message body after the headers.

req.end(data)

End the message body, optionally writing an additional Buffer or string data first.

install

With npm do:

npm install pony

tests

With npm do:

npm test

pony comics

more shetland pony adventures

pony returns

license

MIT

Something went wrong with that request. Please try again.