Mailgun.sendPlaintextEmail()

Send a simple plaintext email.

Usage

Hover over inputs/exits for more info.

var Mailgun = require('machinepack-mailgun');


// Send a simple plaintext email.

Mailgun.sendPlaintextEmail({

apiKey: 'key-3432afa32e9401482aba183c13f3',

domain: 'sandbox5f89931913a9ab31130131350101.mailgun.og',

toEmail: 'jane@example.com',

toName: 'Jane Doe',

subject: 'Welcome, Jane!',

message: 'Jane,\nThanks for joining our community. If you have any questions, please don\'t hesitate to send them our way. Feel free to reply to this email directly.\n\nSincerely,\nThe Management',

fromEmail: 'harold@example.enterprise',

fromName: 'Harold Greaseworthy',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function () {

 

},

});

Inputs

apiKey required

The API key of the Mailgun account to use.

'key-3432afa32e9401482aba183c13f3'
domain required

The Mailgun domain to use.

'sandbox5f89931913a9ab31130131350101.mailgun.og'
toEmail required

Email address of the primary recipient.

'jane@example.com'
toName

Full name of the primary recipient.

'Jane Doe'
subject

Subject line for the email.

'Welcome, Jane!'
message

The plaintext body of the email.

'Jane,\nThanks for joining our community.  If you have any questions, please don\'t hesitate to send them our way.  Feel free to reply to this email directly.\n\nSincerely,\nThe Management'
fromEmail

Email address of the sender.

'harold@example.enterprise'
fromName

Full name of the sender.

'Harold Greaseworthy'

Exits

error

An unexpected error occurred.

success

OK.