Plugin mail not working on Servoy 7

Questions and answers on developing, deploying and using plugins and JavaBeans

Plugin mail not working on Servoy 7

Postby stefaniacolombara » Fri Sep 06, 2019 4:57 pm

Hello,

The plugin.mail doesn't work anymore on Servoy 7 while working well on Servoy 8. Anyone with the same issue?

Everytime I try to send an email, the error "could not connect to SMTP" appears. I think there is a problem with the TLS 1.2 protocol.

Thank you,
Stefania
Attachments
Annotazione 2019-09-06 155226.jpg
Annotazione 2019-09-06 155226.jpg (14.48 KiB) Viewed 2653 times
stefaniacolombara
 
Posts: 40
Joined: Mon Feb 06, 2012 11:19 am

Re: Plugin mail not working on Servoy 7

Postby swingman » Sat Sep 07, 2019 3:12 pm

HI Stefania,

I use the following for Office365 to force TLS 1.2:
Code: Select all
/**
* @properties={typeid:24,uuid:"AABE20D5-EBA6-4210-BA5F-AA5747432095"}
* @return {Array<String>}
*/
function email_settings() {
     /** @type {Array<String>} */
    return new Array('mail.smtp.starttls.enable=true','mail.smtp.ssl.enable=false','mail.smtp.port=587', 'mail.smtp.tls.enable=true', 'mail.smtp.ssl.protocols=TLSv1.2', 'mail.smtp.host=smtp.office365.com');
}


Then I use this as the last parameter when calling

sendMail(to, from, subject, msgText, cc, bcc, attachment, email_settings())
Christian Batchelor
Certified Servoy Developer
Batchelor Associates Ltd, London, UK
http://www.batchelorassociates.co.uk

http://www.postgresql.org - The world's most advanced open source database.
User avatar
swingman
 
Posts: 1472
Joined: Wed Oct 01, 2003 10:20 am
Location: London

Re: Plugin mail not working on Servoy 7

Postby stefaniacolombara » Fri Sep 13, 2019 2:55 pm

Hi Swingman,

Thanks for the reply.

I have the same problem with different host not only with Office365.
Any advice on how to force the TLS 1.2 for different host?
stefaniacolombara
 
Posts: 40
Joined: Mon Feb 06, 2012 11:19 am

Re: Plugin mail not working on Servoy 7

Postby lwjwillemsen » Fri Sep 13, 2019 4:31 pm

We added "mail.smtp.ssl.trust="+_send_host to the send properties of the plugins.mail.sendMail() command.
Where _send_host is the name of the mail server.

In our case that solved the problem.

Regards,
Lambert Willemsen
Vision Development BV
lwjwillemsen
 
Posts: 680
Joined: Sat Mar 14, 2009 5:39 pm
Location: The Netherlands


Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 7 guests