问题
below is the work item handler currently we have to send email in JBPM 7.32.
But we are getting error java.lang.RuntimeException: Unable to send email
".
new org.jbpm.process.workitem.email.EmailWorkItemHandler("smtp.gmail.com", "465", "ax@gmail.com", "x@gmail.com",true)
Could you please help.
Below is the sample workflow we have , to just send an email.
below is the settings where we have this e-mail work item handler.
回答1:
- Delete the Email task from your BPMN web Design (process graphic)
- Delete the Email from Work Item Handlers
- go to Settings/Service Tasks and Install Email (if it is installed, unistall it and click on install)
- fill the form with required parameters:
host : smtp server host name
port : smtp server port number
username : account to be used when login to SMTP server (the email address)
password : account's password to be used when login to SMTP server - if you provide all this informations, the Work Item Handler will be generated automatically ( you can check it in Settings/Deployments/ work Item Handlers), DON'T EDIT IT !
- Go back to your Process, and insert again the email task as in the following screen shot
- Select your Email task, go to the Diagram properties (on the right), and click on Assignments.
- You can now assign global variables or constants to each attribute (Body,From,Subject,To)
From : valid email address
To : valid email address of the recipients (to specify multiple addresses separate them with semicolon ';')
Subject : email subject
Body : email body (can include html)
来源:https://stackoverflow.com/questions/60485774/configure-workitemhandler-to-send-email-in-jbpm-7