Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Is it possible to send email from a Scriptrunner using gmail SMTP?

I am trying to implement a script and run it with Scriptrunner that sends an email using the gmail SMTP.

I tried several script examples I found online, most of them from the Atlassian Community, but none worked (I received compilation errors about missing classes).

I know that with a script one cannot send an email using the SMTP of Atlassian, as this is not a SMTP. This is why i was thinking in using the gmail SMTP.

1 answer

0 votes

If you want to bypass the jira email system altogether, you'll need to import some smtp  or mail handler class.

At this point, you're dealing with standalone groovy/java and you'll have better luck with generic forums rather than jira/atlassian specific ones.

Quick google got this as first hit:

Hi Peter!


Thanks a lot for your answer!

What you suggest is exactly what I tried, but didn't manage, as I got the error message something that the imports are not found.

Having Jira in Cloud and having these problems, made me ask about this in the Atlassian Community.

I don't have access to a cloud instance, but does scriptrunner with cloud support grapes?

It looks like the javax.mail is available in a public maven library

You can try this

import javax.mail.*
import javax.mail.internet.*
@Grab(group='javax.mail', module='mail', version='1.4'

It may not work the very first time since it takes a bit of time to download the library in the cache. 

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Confluence Cloud

Share your Confluence Cloud experience for a chance to win $500!

Take our 5-minute survey to win a $500 Visa gift card! Are you currently using Confluence Cloud? We want to hear from you! Fill out this quick survey about your Confluence Cloud experience so we ...

293 views 5 14
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you