Send mail, and return undefined
See original GitHub issue8.0.0 on Mac OS X
const mailgun = new Mailgun({
apiKey: <API key>,
domain: <API Base URL>,
});
const data = {
from: '<Default SMTP Login>',
to: user.email,
subject: '<Subjet>',
html: `<context>`
}
mailgun.messages().send(data, function (err, body) {
if (err) {
console.log("got an error: ", err);
}
else {
console.log(body);
}
});
When I try to log out the body, It just keep returning undefined
but didn’t return an error?
Issue Analytics
- State:
- Created 6 years ago
- Comments:15
Top Results From Across the Web
Nodemailer's sendMail function returns "undefined"
I have the following code. The commented lined never get executed and info.response returns "undefined". Could you help me figure out why it's...
Read more >Send mail, and return undefined · Issue #150 - GitHub
For me the problem is consistent, and curl works fine. I should also note that the email never sends with mailgun-js. It will...
Read more >Email.send does not return - help - Meteor forums
Hi, I'm trying to get return value from SMTP server after sending an email but Email.send returns undefined on success.
Read more >Mail::send is failing with undefined index error - Laracasts
Mail ::send is failing with undefined index error. Hi Guys -. Got a strange one here. I've got the same mail sending code...
Read more >Email sent to 'Undefined' contact - Microsoft Community
Hi JTo7, As long as the actual email address is correct, it was sent. Undefined was used for the display name for some...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Spent a while debugging this same error before I came across this issue. I was using the full api url
https://api.mailgun.net/v3/<domain>
instead of justdomain
.Definitely a user error but a proper error message would have helped. Even if it was just an ‘invalid domain’ error.
Hmm domain should just be something like:
'sandbox12345.mailgun.org'
. http://bojand.github.io/mailgun-js/#/?id=options