Page 1 of 1

Plugin mail not working on Servoy 7

PostPosted: Fri Sep 06, 2019 4:57 pm
by stefaniacolombara
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

Re: Plugin mail not working on Servoy 7

PostPosted: Sat Sep 07, 2019 3:12 pm
by swingman
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())

Re: Plugin mail not working on Servoy 7

PostPosted: Fri Sep 13, 2019 2:55 pm
by stefaniacolombara
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?

Re: Plugin mail not working on Servoy 7

PostPosted: Fri Sep 13, 2019 4:31 pm
by lwjwillemsen
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,