cancel
Showing results for 
Search instead for 
Did you mean: 

Sending mails with Activiti using Gmail as SMTP

matias
Champ in-the-making
Champ in-the-making
I wanted to use Gmail as SMTP.

I did …

conf.setMailServerHost("smtp.gmail.com");
conf.setMailServerPort(587);
conf.setMailServerUsername("myname@gmail.com");
conf.setMailServerPassword("mypassword");

But at first it did not work because Gmail requires TLS.

So I added the following line in org.activiti.engine.impl.bpmn.MailActivityBehavior.setMailServerProperties()

email.setTLS(true)

And now it works!

It would be great if you add setMailTLS or something like that to the conf API.

Thanks!
3 REPLIES 3

frederikherema1
Star Contributor
Star Contributor
Matias,

Seems like a valid addition to email-task configuration. Can you create an issue for this in Jira http://jira.codehaus.org/browse/ACT ?

limcheekin
Champ on-the-rise
Champ on-the-rise
Hi Matias,

I managed to make it works by setting the system properties on application startup using the following groovy codes:

["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false",
"mail.smtp.starttls.required": "true"].each { k, v ->
     System.setProperty k, v
}

But I think your suggestion is good idea.

Regards,
Chee Kin

tstephen
Champ on-the-rise
Champ on-the-rise
Hi,

I've just added a patch to http://jira.codehaus.org/browse/ACT-456.

regards,
Tim