cancel
Showing results for 
Search instead for 
Did you mean: 

gmail with Activiti 6

sas
Confirmed Champ
Confirmed Champ
Hi,
I am sure many peoples were asking similar question with earlier version, but now I having problem in the activit-app configuration to get the mail working Smiley Sad
my related config is (similar values to any other mail client I have)
————————————–
email.enabled=true
email.host=smtp.gmail.com
email.port=587
email.useCredentials=true
email.username=YYYYYY
email.password=XXXX
#email.ssl=false
email.tls=true
# The base url that will be used to create urls in emails.
email.base.url=http://localhost:8080/activiti-app
——————————————-
and I am getting the following still from the server
—————————–
220 smtp.gmail.com ESMTP l1sm1484173wjy.17 - gsmtp
EHLO 05f888c24429
250-smtp.gmail.com at your service, [188.6.110.91]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
MAIL FROM:<XXXXXXX>
530 5.7.0 Must issue a STARTTLS command first. l1sm1484173wjy.17 - gsmtp
RSET
250 2.1.5 Flushed l1sm1484173wjy.17 - gsmtp
QUIT
221 2.0.0 closing connection l1sm1484173wjy.17 - gsmtp
————————————————
Why activiti not sending STARTTLS ?
(I am sure my config is wrong somewhere…)
Thanx
sas
6 REPLIES 6

sas
Confirmed Champ
Confirmed Champ
Hi,
Is there anyone who managed to send a mail (for example via gmail using TSL) with activiti-app? (The new Angular based interface)
Anything I do I am getting
530 5.7.0 Must issue a STARTTLS command first.
(see above)
Thanx
sas

jmulieri
Champ in-the-making
Champ in-the-making
Hi, I debugged this a while ago and ended up just using postfix. However, this is the solution if you want to send to gmail directly from Activiti.

Add the following code to ActivitiEngineConfiguration.java#processEngineConfiguration, anywhere inside the not-empty emailHost conditional, like so:

<java>
if (StringUtils.isNotEmpty(emailHost)) {
  // existing code here …
  if (environment.getProperty("email.tls", Boolean.class, false)) {
    processEngineConfiguration.setMailServerUseTLS(true);
  }
}         
</java>

BTW, you'll probably need this: https://support.google.com/accounts/answer/6010255?hl=en

Cheers!
Jon

skenguva
Champ in-the-making
Champ in-the-making
Jon, sas
I have the same issue.
Is there any alternative method to resolve this issue?
I want to resolve the issue without changing the code. Possible?

rallegre
Star Contributor
Star Contributor

Here is the gmail config that I used with Activiti Enterprise 1.5.2

It worked well:

email.enabled=true
email.host=smtp.gmail.com
email.port=587
email.useCredentials=true
email.username=email@gmail.com
email.password=your password of gmail
email.ssl=false
email.tls=true
email.base.url=http://localhost:8080/activiti-app
email.from.default=email@gmail.com
email.from.default.name=Activiti
email.feedback.default=email@gmail.com

vikash_patel
Star Contributor
Star Contributor

Hi,

With Gmail Conf

email.host=smtp.gmail.com
email.port=465
email.encoding=UTF-8
email.username=xxx@gmail.com
email.password=xxx
email.protocol=smtps
email.from.default=xxx.com
email.smtps.starttls.enable=true
email.smtps.auth=true

or you can may refer this link Activiti User Guide 

ivanca
Champ in-the-making
Champ in-the-making

Hi I have tried using your configuration for the latest version of Activiti (6.0.0) in the activiti-app.properties file in /Applications/tomcat/webapps/activiti-app/WEB-INF/classes/META-INF/activiti-app but it does not work for me, I also tried it with yahoo but that does not work either, any suggestions? 

Following is my yahoo configuration: 

email.enabled=true
email.default=xxx@yahoo.com
email.host=smtp.mail.yahoo.com
email.port=465
email.username=xxx@yahoo.com
email.password=xxxx
email.protocol=smtps
email.smtps.starttls.enable=true
email.smtps.auth=true

And following is the error I get both for gmail and yahoo: 

Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.mail.yahoo.com, port: 465, response: -1

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:2041)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:697)

at javax.mail.Service.connect(Service.java:364)

at javax.mail.Service.connect(Service.java:245)

at javax.mail.Service.connect(Service.java:194)

at javax.mail.Transport.send0(Transport.java:253)

at javax.mail.Transport.send(Transport.java:124)

at org.apache.commons.mail.Email.sendMimeMessage(Email.java:1411)

... 104 more