Send email to own instance

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-12-2018 02:17 AM
We are trying to send an email to our own instance URL using a server script. This is for us to create an incident record even if a user is not logged in. We tried the code below however, the recipient was changed by ServiceNow to be same as the User ID field. Basically we want to have our instance think that the email was sent by the user_id and process it accordingly.
var sysemail = new GlideRecord('sys_email');
sysemail.type = 'send-ready';
sysemail.recipients = 'instance@service-now.com';
sysemail.subject = 'Subject Here';
sysemail.user_id = 'user id here';
sysemail.body = 'TEST';
sysemail.insert();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-20-2018 01:21 AM
Hi Rajesh,
Are you sure that there was a recived email when you tried the code I provided. Because upon further checking - yes there is value in recipient field however the system removed the To part of the email header, send the outbound email was marked as send-ignored.