Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw error - TypeError: object is not iterable #2

Open
jignesht24 opened this issue Feb 15, 2024 · 1 comment
Open

Throw error - TypeError: object is not iterable #2

jignesht24 opened this issue Feb 15, 2024 · 1 comment

Comments

@jignesht24
Copy link

Hi

I am using this node in node--red but when I try to send email it throw error

TypeError: object is not iterable
at node:internal/deps/undici/undici:6155:39
at extractBody (node:internal/deps/undici/undici:6170:11)
at new Request (node:internal/deps/undici/undici:7114:48)
at new Ky (C:\Users\xxx.node-red\node_modules\mailgun.js\mailgun.node.js:2:60421)
at t (C:\Users\xxx.node-red\node_modules\mailgun.js\mailgun.node.js:2:64310)
at e. (C:\Users\xxx.node-red\node_modules\mailgun.js\mailgun.node.js:2:35504)
at C:\Users\xxx.node-red\node_modules\mailgun.js\mailgun.node.js:2:34536
at Object.next (C:\Users\xxx.node-red\node_modules\mailgun.js\mailgun.node.js:2:34641)
at C:\Users\xxx.node-red\node_modules\mailgun.js\mailgun.node.js:2:33553

I have tried to use following Nodejs code and run in local machine, it is sending an email.

const API_KEY = 'YOUR_API_KEY';
const DOMAIN = 'YOUR_DOMAIN_NAME';

import formData from 'form-data';
import Mailgun from 'mailgun.js';

const mailgun = new Mailgun(formData);
const client = mailgun.client({username: 'api', key: API_KEY});

const messageData = {
from: 'Excited User [email protected]',
to: '[email protected], [email protected]',
subject: 'Hello',
text: 'Testing some Mailgun awesomeness!'
};

client.messages.create(DOMAIN, messageData)
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
});

Can you please help here?

I am using Node-RED version: v3.1.3, Node.js version: v19.4.0

@sinchflows
Copy link
Collaborator

Hello,
Could you please provide an example flow that recreates the issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants