Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const request = require('request');
- const options = {
- url: 'https://lnp....api.infobip.com/email/1/send',
- reqType: "POST",
- json: {
- from: 'Rodrigo <cop@sd1...m>',
- to: 'rodrc...il.com',
- subject: 'Test Subject',
- html: '<h1>Html body</h1><p>Rich HTML message body.</p>'
- },
- headers: {
- 'Authorization': 'App ca8c0e09e3ad4058f5b...',
- 'Content-Type': 'application/json',
- 'Accept': 'application/json'
- }
- }
- request.post(options,(err, response) => {
- if (err){
- return console.log(err)
- }
- console.log(`Status code: ${response.statusCode}. Message: ${response.body}`);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement