How to send an email from ServiceNow?

dev115415
Tera Expert

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?

1 ACCEPTED SOLUTION

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();

View solution in original post

27 REPLIES 27

In the previous question you asked about changing the sender of the email.

Now I believe you are asking about configuring the receiver of the email, which can be done in another section (Who will receive) of the notification

 

I'm not following on how you mean by "send from a gmail", do you mean you want to send the email to a gmail address?

I want to send email from a gmail account say sender1@gmail.com to receiver1@gmail.com

You can change all the required details in the notification you've created.

See example images below.

Do note, that for the emails to actually be sent from your PDI, you will need to activate email sending and receiving in your PDI, otherwise the email is only available in the instance by navigating to:

System Mailboxes > Sent

 

specify-send-to-email.png

specify-send-from-email.png

Hello I have done all this and my mails are coming in sent tab of ServiceNow also. But I am not receiving these mails to my actual mail id. What to do

Hi @dev115415,

 

You are performing all these operations in your PDI? If yes then email notifications are disabled in PDIs by ServiceNow. If you are able to see the notifications in your sent box that means the emails are getting triggered and the same will work in your company instance properly.

Please mark this answer as correct and helpful, if it solved your query.

 

 

Thanks,
Mohit Kaushik
ServiceNow MVP (2023-2025)