Package: mail
Installation
Install the bundle
In the karaf console type the folowing command:
bundle:install mvn:one.erp/one.erp.workflow.ext/1.4
Configure the bundle
In the karaf console type the folowing commands:
config:edit one.erp.workflow.ext.mail config:property-set from no-reply@onesoftware.ro config:property-set host smtp.gmail.com config:property-set port 465 config:property-set secure true config:property-set startTLS true config:property-set auth true config:property-set user vlad@onesoftware.ro config:property-set password pass config:property-set overrideSystemProperties true config:update
Configuration
PID: one.erp.workflow.ext.mail
Property | Default value | Description |
---|---|---|
from | no-reply@onesoftware.ro | The from field for all the send emails |
host | smtp.gmail.com | The host |
port | 465 | The port |
secure | true | true is the connection is secure, false otherwise |
startTLS | true | true if STARTTLS command should be used, false otherwise |
auth | true | true if the mail server requires authentication, false otherwise |
user | the user name for authentication | |
password | the password for authentication | |
overrideSystemProperties | true | true if the system properties (java) should be overridden |
API
send
function send(to as string, subject as string, body as string) as bool
Sends an email.
sendFile
function sendFile(to as string, subject as string, body as string, idStorageFile as int) as bool
Send an email with a file as an attachment.
isValidAddress
function isValidAddress(address as string) as bool
Returns true
if the specified email address is valid.