const gmailSend = require("gmail-send")({
user: "foo@bar.com",
pass: "foobarfoobar",
to: [
"foo@bar.com",
"bar@bar.com",
"baz@bar.com" // this is picked up quoted
],
subject: "Hello world",
text: "Hello world"
});
The above sends emails to these addresses:
foo@bar.com // OK, receives the email,
bar@bar.com // OK, receives the email,
"baz@bar.com" // this is sent quoted - which causes this address not to receive the email at all.
Screenshot from Gmail
Here's a screenshot from my Gmail "to" field showing this issue:
In the following code:
The above sends emails to these addresses:
foo@bar.com // OK, receives the email, bar@bar.com // OK, receives the email, "baz@bar.com" // this is sent quoted - which causes this address not to receive the email at all.
Screenshot from Gmail
Here's a screenshot from my Gmail "to" field showing this issue: