- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2023 03:48 AM
Hello I want to send an email to some person based on some logic of my app. I would like to do this from ServiceNow-> Script Include. How to do this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2023 09:56 AM - edited ‎06-01-2023 01:15 AM
Hello Thank you for your response
I will tell what I have done.
1. I created an Event Registry simply.
2. I created a Notfication
3. I created a Script Include and there I used
gs.eventQueue('x_8041114_needlt.EmailEvent1',current,'abc@gmail.com','axyz@gmail.com');
Update
Now I am able to send the email but I have to use the glideobject as 2nd parameter. But I do not want to use that. I do not want to use glideobject because my business logic doesn't need it. I want to use eventQueue() in a way that I pass the event name that will be fired, and some normal parameters but no glideobject. How should I write eventQueue();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2023 04:10 AM
Hi,
One way to do this is to have the script include generate an event, and register an email notification that is sent when the event occurs.
Have a look at the Docs to get an example on how to work with events.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2023 05:02 AM
Hello can I put the sender of email to be an arbitrary person(not the same as servicenow user).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2023 06:21 AM
In the notification you create, you can specify the sender of the email, if needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-29-2023 10:07 AM - edited ‎05-29-2023 10:10 AM
thanks for your help. but still I am not receiving the mail. Interestingly I see the mails in Outbox in ServiceNow but they are not sent.
Could you please tell will I be able to send from a gmail like abc@gmail.com to xyz@gmail.com?