email.sendBulk “SSS_INVALID_TO_EMAIL” error
I have a function that contains the following:
function sendEmails(ids) {
var fileObj = file.load({
id: ‘************’
});
var fileContent = fileObj.getContents();
log.debug(’email address to send: ‘, ids);
try {
email.sendBulk({
author: ‘**’,
body: fileContent,
recipients: ids,
subject: ************* Price Adjustments’
});
log.debug(’email sent: ‘, ’email sent’);
} catch (e) {
log.debug(’email send bulk exception: ‘, JSON.stringify(e));
}
}
I starred out certain things for privacy reasons. The ids argument is in correct format; it gives back an array of email addresses. I’m currently testing with my email address and I’m still getting this error in the catch statement:
type: "error.SuiteScriptError",
name: "SSS_INVALID_TO_EMAIL",
message: "One or more recipient emails are not valid."
How do I test this out so it sends emails to me
rather than throwing this error?
Hi,
When you say testing with your email address, id “ids” number[] or string[]?
Thanks,
Chris
string[]
Can you post here the array of email addresses returned by your code? Also, are you sure that the author is a valid NetSuite employee in NetSuite? Another thing to check – the maximum of 10 recipients (recipient + cc + bcc) is allowed.
Thanks,
Lea
We do the heavy lifting for your NetSuite Development projects so you can focus on growing your business.



