Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×i configured SMTP in jira but when i am trying to send email smtp always null.also email object "from" return null
Example code:
Email em = new Email("bscitramesh@gmail.com");
System.out.println("em;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"+em);
em.setSubject("Example Subject");
em.setBody("Hello");
em.setEncoding("text/plain");
SingleMailQueueItem smqi = new SingleMailQueueItem(em);
System.out.println("smqi;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"+smqi);
ComponentAccessor.getMailQueue().addItem(smqi);
Here is a working example for custom email with Jira JAVA API
import com.atlassian.mail.Email;
import com.atlassian.mail.queue.SingleMailQueueItem;
Email email = new Email("email_address@company.com");
email.setCc("another_email_address@company.com");
email.setFromName("what ever you want");
email.setSubject("what ever you want");
email.setBody("what ever you want");
email.setMimeType("text/html");
SingleMailQueueItem smqi = new SingleMailQueueItem(email);
ComponentAccessor.getMailQueue().addItem(smqi);
Note that "setCc" and "setFromName" are not mandatory, you can remove these rows if you don't want them.
You can check your mail queue in Jira to make sure your code works and email are going to the queue.
If the email not sending then you configured the mail server wrong.
Try the code, check if you see the mail in the queue, and/or it being sent.
Let me know the outcome.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi guys, does someone has an example of How I can send an outlook event "Appointment" from JIRA?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not an example, but a hint.
setMultipart(javax.mail.Multipart appointment)
There are multiple examples of the format scattered around the internet...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.