how to apply forwarding in email
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 02:15 AM
HI All,
i have two prod instance
1.old Prod instance
2. New Instance Prod
Now after some days my old prod instance is going to shut and my requirement is that i want to apply forwarding to old prod instance so that wherever any user created incident using old prod instance Email, Email will get forwarded To new prod instance Email. Please help.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 02:27 AM
Hi,
The easiest way is to create a business rule, which makes a copy of all received emails, and then creates a new mail in the outbox sending it to the other instance.
To create an email directly in the outbox do this:
var mail = new GlideRecord("sys_email");
mail.initialize();
mail.mailbox.setDisplayValue("Outbox");
mail.recipients = ("otherinstance@service-now.com");
mail.subject = ("Fw: " + current.subject);
mail.body = (current.body);
mail.type = "send-ready";
mail.content_type = "multipart/mixed";
mail.insert();
Regarding the processing of an email (target, header, etc) this is not done via business rules, so you can't access that part of the code.
Please mark correct or helpful based on the impact.
Regards,
Aniket Sawant.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2020 02:28 AM
Below thread should help.
Thanks