one or more email address was invalid,(local address containing illegal character
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
Hi
I am getting below error in test but same script is working in dev , could you please help on this
email script I am using in send email
var recepients = fd_data._1__get_catalog_variables.select_list_of_users_to_send_emails;
var groupmembers = new GlideRecord('sys_user_grmember');
groupmembers.addQuery('group','4809499747cb4e90c996889d416d43d0'); // KA_Rating_ApplicationGroup sys_id
groupmembers.query();
while(groupmembers.next())
{
recepients += ","+ groupmembers.user;
}
return recepients;
Could you please help on this, Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
4 hours ago
variable "select_list_of_users_to_send_emails" is of what type?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
Hi @Ankur Bawiskar
select_list_of_users_to_send_emails is a list collector
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 hours ago
@nandini29 Did you check your user table ? Are there invalid emails?
Is this your prod instance? Subprod instances have invalid emails sometimes.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Did you print what came in that list collector and array and see if some email address has invalid character for the group members?
-> any space in the email address which you are fetching => if yes then use trim()
var recepients = fd_data._1__get_catalog_variables.select_list_of_users_to_send_emails;
var groupmembers = new GlideRecord('sys_user_grmember');
groupmembers.addQuery('group', '4809499747cb4e90c996889d416d43d0'); // KA_Rating_ApplicationGroup sys_id
groupmembers.query();
while (groupmembers.next()) {
recepients += "," + groupmembers.user.email.trim().toString();
}
gs.info('Recipients are' + recepients);
return recepients;
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
⨠Certified Technical Architect || ⨠9x ServiceNow MVP || ⨠ServiceNow Community Leader