Hi Niolo,
While Jon is correct in that you cannot configure standard Ebase to use SSL, you can achieve the same thing by writing a script to sent the emails for you (DOES NOT USE AN EBASE EMAIL RESOURCE)
I will email you a working example form and script
The following is the code contained in the script
Code: Select all
importPackage(com.ebasetech.xi.api);
importPackage(com.ebasetech.xi.services);
var _java = JavaImporter(javax.mail, javax.mail.internet, java.util);
/* ---------------------
Create smtp variables
---------------------*/
var smtpHost = 'smtp.gmail.com';
var smtpPort = 465;
var smtpUser = fields.SMTPUSER.value;
var smtpPassword = fields.SMTPPASSWORD.value;
/* -------------------------
Populate smtp properities
-------------------------*/
var props = new _java.Properties();
props.put("mail.smtp.host", smtpHost);
props.put("mail.smtp.port", smtpPort);
props.put("mail.smtp.user", smtpUser);
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.socketFactory.port", smtpPort);
props.put("mail.smtp.socketFactory.class",
"javax.net.ssl.SSLSocketFactory");
props.put("mail.smtp.socketFactory.fallback", "false");
props.put("mail.smtp.ssl", "true");
/* --------------------------
Create a new SMTP session
--------------------------*/
var session = _java.Session.getInstance(props);
/* -----------------------------
Create the message to be sent
-----------------------------*/
var message = _java.MimeMessage(session);
message.setFrom(
new _java.InternetAddress(fields.FROMEMAIL.value, fields.FROMNAME.value)
);
message.setRecipients(
_java.Message.RecipientType.TO,
[new _java.InternetAddress(fields.TOEMAIL.value, true)]
);
message.setText(fields.BODY.value);
message.setSubject(fields.SUBJECT.value);
message.setSentDate(new Date());
/* ------------------------------------------------
Connect to the SMTP session and sent the message
------------------------------------------------*/
var transport = session.getTransport("smtps");
transport.connect (smtpHost, smtpPort, smtpUser, smtpPassword);
transport.sendMessage(message, message.getAllRecipients());
transport.close();