Pass empty value for OverrideProperties in mail plugin

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

Pass empty value for OverrideProperties in mail plugin

Postby glenn.boudaer1412844863 » Wed Dec 03, 2014 11:58 am

I am currently working with the Servoy mail plugin to send an email to a certain address.
In the Servoy Server Plugin Settings I have entered a value in the property mail.development.override.address. However, in a particular case I wish to set this value empty before sending an email with the plugin. This is the code I have:

Code: Select all
var properties = new Array()
properties[0] = 'mail.development.override.address='
plugins.mail.sendMail( _mailto,  _mailfrom,  _mailsubject,  _mailmessage, null, null, null, properties)

Unfortunately this does not work. I have tried different values such as 'null', a space (with and without escaping single quotes) but it keeps throwing an error.

Can someone explain to me how I can pass empty values in the OverrideProperties parameter of the mail plugin?

Kind regards
Posts: 4
Joined: Thu Oct 09, 2014 10:54 am

Re: Pass empty value for OverrideProperties in mail plugin

Postby jcompagner » Wed Dec 31, 2014 5:42 pm

if i look at the code of the mail plugin, that should work
I see that the default properties are overwritten by the given value.
The only thing is that the value is then an empty string instead of a null value. and i guess then you are not using anything at all as a Recipients

if you give it a actual value then it does really override right?

You could make a case so that we also check for a "" string instead of just null (because if that property is an empty string is should also don't do anything with it)
Johan Compagner
User avatar
Posts: 8837
Joined: Tue May 27, 2003 7:26 pm
Location: The Internet

Re: Pass empty value for OverrideProperties in mail plugin

Postby grahamg » Wed Dec 31, 2014 7:31 pm

I haven't used mail.development.override.address but some time ago was seeing errors if Users sent Emails without a Subject.

Added a space " " at start of both Subject and Message which fixed the problem. Might be worth a try.
Graham Greensall
Worxinfo Ltd
Posts: 752
Joined: Fri Oct 03, 2003 3:15 pm
Location: Midlands UK

Return to Plugins and Beans

Who is online

Users browsing this forum: No registered users and 1 guest