Skip to content

Instantly share code, notes, and snippets.

@skorytnicki
Last active November 29, 2022 14:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skorytnicki/33556a91f20bb0a4e8a8d0ed4e0ffa15 to your computer and use it in GitHub Desktop.
Save skorytnicki/33556a91f20bb0a4e8a8d0ed4e0ffa15 to your computer and use it in GitHub Desktop.
EmailLabs Node.js integration
const request = require('request');
const smtp = '1.yoursmtp.smtp';
const appkey = 'yourappkey';
const secret = 'yoursecret';
const options = {
method: 'POST',
url: 'https://api.emaillabs.net.pl/api/new_sendmail',
form: {
smtp_account: smtp,
to: {
'email@domain2.com': [{'email@domain2.com':parseInt(Math.random()*10000,10)+'@domain2.com'}],
'email@domain3.com': [{'email@domain3.com':parseInt(Math.random()*10000,10)+'@domain3.com'}]
},
subject: 'Just bothering people',
html: '<p>Test</p>',
txt: 'Test',
from: 'email@domain.com',
from_name: 'Tester'
},
headers: {
'Authorization': 'Basic '+ new Buffer(appkey + ":" + secret).toString("base64")
}
}
request(options);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment