- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 05:37 AM
I have used the following script to send the mail, but it is not working.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 08:58 AM
Hi @Dhanyasri ,
Please refer below code
var mail = new GlideEmailOutbound();
mail.setSubject('Outbound Email Send');
mail.setBody('Hello, Email send successfully');
mail.addRecipient('adela.cervantsz@example.com');
mail.save();
It got updated in email log table as well
Please mark my answer correct and helpful if it works for you
Thanks and Regards
Sarthak
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 05:51 AM
HI @Dhanyasri ,
I trust you are doing great.
please find the updated code for the same :
try {
var email = new GlideEmailOutbound();
email.setSubject('Test Email from ServiceNow');
email.setBody('This is a test email sent from ServiceNow.');
email.addTo('abel.tuter@example.com');
email.send();
gs.info('Email sent successfully.');
} catch (ex) {
gs.error('Failed to send email: ' + ex);
}
Was this answer helpful?
Please consider marking it correct or helpful.
Your feedback helps us improve!
Thank you!
Regards,
Amit Gujrathi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 06:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2024 03:38 AM
Hi @Amit Gujarathi ,
email.save() is creating an entry to the system mailboxes -> outbounds table, but it is not triggering any email. if I do email.send() also I am not receiving any email in my mailbox.
Am I doing anything wrong?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-10-2024 05:53 AM
HI @Dhanyasri
please follow some threads for triggering notification some ways:-
https://tech.forums.softwareag.com/t/servicenow-email-notification/237436
https://tech.forums.softwareag.com/t/servicenow-email-notification-via-event/237437
Please mark reply as Helpful/Correct, if applicable. Thanks!