Last active
April 26, 2024 20:30
-
-
Save skorytnicki/33556a91f20bb0a4e8a8d0ed4e0ffa15 to your computer and use it in GitHub Desktop.
EmailLabs Node.js integration
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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