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: '[email protected]',

toName: 'Jane Doe',

subject: 'Welcome, Jane!',

message: 'Jane,\n' + "Thanks 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" + '\n' + 'Sincerely,\n' + 'The Management',

fromEmail: '[email protected]',

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.

'[email protected]'
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,\n' +
  "Thanks 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" +
  '\n' +
  'Sincerely,\n' +
  'The Management'
fromEmail

Email address of the sender.

'[email protected]'
fromName

Full name of the sender.

'Harold Greaseworthy'

Exits

error

An unexpected error occurred.

success

OK.