email.addAddress() not working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Can anyone tell me why this script does not update the 'copied' field in the email log. The log statement does display the correct email addresses.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Rachel55
So, your script is correct the reason you don’t see updates in the Email Log is that the copied field isn’t written during the mail script execution.
That’s why you won’t see the copied field update at mail script runtime it’s only populated when the outbound message is finalized into the sys_email record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @Rachel55
I hope it doesn't matter but can you try with 'cc' string type in lower case?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago - last edited 3 weeks ago
Hi @Rachel55 ,
You need to use email.addAddress() Properly as in your email notification M\mail Script, include CC or BCC like:
(function runMailScript(current, template, email, email_action, event) {
email.addAddress("cc", "user@example.com", "User Name");
email.addAddress("bcc", "secret@example.com", "Secret example");
})(current, template, email, email_action, event);
Ensure these scripts are included via ${mail_script:your_script_name} in the Notification record. After that, confirm Email is Sent, Not Just Previewed, because CC/BCC are handled during message finalization, always verify by checking the record under System Mailboxes → Outbound → Sent.
If you found my response helpful, please mark it as ‘Accept as Solution’ and ‘Helpful’. This helps other community members find the right answer more easily and supports the community.
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
This did not work. I am using email.addAddress("cc", userGR.email, name). The rest of the mail script is working fine, it just does not add the recipients.