bpel - WSO2 BPS - mailing activity -
i need have activity send mail @ point of bpel process.
is there "mail activity" or have code sort of web services invoke call service , let send mail?
could solution use esb business?
how connect 2 (again web services or there quicker , easiest way link them)?
could solution in case add esb feature bps add transport feature without having add esb this?
also i've seen there example around uses transportsender in axis2.xml using proxy, seems method send mail same address need able send mail subject (an possible cc , bcc) parameters of process (on previous step read data db , there address information) tensportsender path follow or have develop mailing service?
any hint?
thanks
luca
as mentioned before, there no mailing activity built-in wso2 bpel, can functionality invoking external web service(dss, as) inside bpel workflow.
i've created 1 workflow such functionality couple days ago. created , axis2 service java code sending email, in can provide parameters such subject, content , receiver, once invoke service can send email email address. deployed axis2 service mentioned wso2 dss , invoke bpel workflow later on deployed wso2 bps.
the java code used sendin email following:
import java.util.properties; import javax.mail.message; import javax.mail.messagingexception; import javax.mail.session; import javax.mail.transport; import javax.mail.internet.internetaddress; import javax.mail.internet.mimemessage; public class mailsender { public static void main(string emailaddress, string content){ string host = "smtp.gmail.com"; string = "example@gmail.com"; string subject = "subject example"; properties props = system.getproperties(); props.put("mail.smtp.host", host); props.put("mail.smtp.user", from); props.put("mail.smtp.password", ""); props.put("mail.smtp.port", "587"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.auth", "true"); try{ session session = session.getdefaultinstance(props, null); internetaddress to_address = new internetaddress(emailaddress); mimemessage message = new mimemessage(session); message.setfrom(new internetaddress(from)); message.addrecipient(message.recipienttype.to, to_address); message.setsubject(subject); message.setcontent(content, "text/html; charset=utf-8"); transport transport = session.gettransport("smtp"); transport.connect("smtp.gmail.com","example@gmail.com","password"); transport.sendmessage(message, message.getallrecipients()); transport.close(); } catch (messagingexception mex) { system.out.println("send failed, exception: " + mex); } } }
Comments
Post a Comment