Java Workflow software email sending Solution

Source: Internet
Author: User

Use the javamail function to integrate the mail sending function into the java Workflow System. The javamail package provides the mail sending method, including setting the sender address, recipient address, CC, topic, email server address, authentication user and other information, and then calling the javamail sending function, the email can be sent. The mail sending function is encapsulated into a common class, and the sender, recipient, authenticated user, mail server address, and other parameters are passed to the common mail class. Set this information at the node where you want to send the email. When the java Workflow Engine executes the flow, it interprets these parameters and executes the mail class, and sends the mail to the specified person. At the beginning of its design, the java Workflow Engine should retain these interfaces for integrated sending of emails, sending of text messages, and other calls. When users have these needs, they can quickly and conveniently set and use these functions. The eworkflow for java version integrates the mail sending function. You can customize the email sending method or call it directly. You can specify the email sending function before and after the node handles the email sending. In the task engine, you can also configure the mail sending function to send emails to the task creator. After the task expires, you can send email notifications to relevant personnel. When the task is completed, you can also send email notifications. Even after the task is assigned, it is sent regularly until the task is completed. The function of sending emails using javaMail is simple String to = (String) args. get ("to"); String from = (String) args. get ("from"); String subject = (String) args. get ("subject"); String cc = (String) args. get ("cc"); String m = (String) args. get ("message"); String smtpHost = (String) args. get ("smtpHost"); get the sender, recipient, subject, email server, and other information messages in the setting information. setSubject (parseVariables? VariableResolver. translateVariables (subject, transientVars, ps). toString (): subject); message. setSentDate (new Date (); message. setText (parseVariables? VariableResolver. translateVariables (m, transientVars, ps ). toString (): m); message. saveChanges (); transport. connect (); transport. send (message); transport. close (); execute the mail sending command to integrate the mail sending function in the java Workflow System, mainly to design the interface of the process engine, you can call the mail sending class at the corresponding node to implement the mail sending function.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.