30.12.2014 Views

Camunda-BPM-Loan-Assessment-Process-Lab-v1.0

Camunda-BPM-Loan-Assessment-Process-Lab-v1.0

Camunda-BPM-Loan-Assessment-Process-Lab-v1.0

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Camunda</strong> <strong>BPM</strong> Platform 2014<br />

Java Code:<br />

package org.camunda.bpm.getstarted.Email1;<br />

import java.util.*;<br />

import javax.mail.*;<br />

import javax.mail.internet.*;<br />

import org.camunda.bpm.engine.delegate.DelegateTask;<br />

import org.camunda.bpm.engine.delegate.TaskListener;<br />

public class SendEmail implements TaskListener {<br />

static String host1 = "smtp.gmail.com";<br />

static String user = "camunda01@gmail.com";<br />

static String pass = "<strong>Camunda</strong>1234";<br />

public void notify(DelegateTask delegateTask) {<br />

String email= getVariable ("Email");<br />

// Recipient's email ID needs to be mentioned.<br />

String to = email;<br />

// Sender's email ID needs to be mentioned<br />

String from = "<strong>Camunda</strong>01@gmail.com";<br />

// Get system properties<br />

Properties properties = System.getProperties();<br />

119<br />

// Setup mail server<br />

properties.put("mail.smtp.socketFactory.port", "465");<br />

properties.put("mail.smtp.socketFactory.class", "javax.net.ssl.SSLSocketFactory");<br />

properties.put("mail.smtp.starttls.enable", "true");<br />

properties.put("mail.smtp.host", host1);<br />

properties.put("mail.smtp.user", user);<br />

properties.put("mail.smtp.password", pass);<br />

properties.put("mail.smtp.port", "465");<br />

properties.put("mail.smtp.auth", "true");

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!