Skip to content

Instantly share code, notes, and snippets.

@skorytnicki
Last active April 26, 2024 20:30
Show Gist options
  • 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 protected]': [{'[email protected]':parseInt(Math.random()*10000,10)+'@domain2.com'}],
'[email protected]': [{'[email protected]':parseInt(Math.random()*10000,10)+'@domain3.com'}]
},
subject: 'Just bothering people',
html: '<p>Test</p>',
txt: 'Test',
from: '[email protected]',
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