How to refer BCC from inbound email?

priyankapalaska
Giga Contributor

Hi,

I want to retrieve BCC address from inbound email. Currently i can refer to, from, cc but not BCC.

could you please help me in this?

Appreciate your quick reply.

Thank You.

15 REPLIES 15

Aravinda YS
Tera Contributor

you can use like below.



email.addAddress("cc", "john.copy@example.com","John Roberts");


email.addAddress("bcc", "john.secret@example.com","John Roberts");



reference : http://wiki.servicenow.com/index.php?title=Scripting_for_Email_Notifications#Adding_CC_and_BCC_recip...


Hi Aravind,



I don't want to add address i want to fetch it from incoming email.


Ramakrishna Kat
Kilo Expert

Hi Priyanka,



I think this code will help you this please refer.



if (!current.watch_list.nil()) {


//get watch list addresses and add to cc


var watcherIds = current.watch_list.split(",");



//get user records


var user = new GlideRecord("sys_user");


user.addQuery("sys_id", watcherIds);


user.addQuery("notification", 2); //email


user.addQuery("email", "!=", "");


user.query();



while (user.next()) {


//add to cc list


email.addAddress("cc", user.email, user.getDisplayValue());


email.addAddress("bcc", user.email, user.getDisplayValue());


}


}



Regards,


Ramakrishna


Actually my question is I want to check where the email address is there in incoming mail. for that i referred email.recipients but this could not find the BCC address.