I am using the mail plug in to send mail. It was working fine in version 2.1.1. Does not work in 2.2.2 or 2.2.3. I am not sending attachments. I do not require authentication so the only property I am passing to the plug in is the SMTP HOST. I have used exactly the same code with different versions of Servoy and it quit working after 2.1.1.
I tried to send an email attachment as I used to, I had not changed any code and I was getting an error. I saw this post and just downloaded the new beta :
Servoy Developer
Version R2 2.2.3-build 335
Java version 1.4.2_04-b05 (Windows XP)
It will not send mail, and as I step through the debugger, I cant tell why it is not successful:
//print the current form as pdf into a variable
var success = plugins.pdf_output.startMetaPrintJob()
if (success)
{
controller.print(false,false,plugins.pdf_output.getPDFPrinter());
}
var thePdf = plugins.pdf_output.endMetaPrintJob()
var attachment1 = plugins.mail.createBinaryAttachment(‘TSEServiceEstimate.pdf’,thePdf);
try
{
var succes = plugins.mail.sendMail(globals.Text6,currentuserglobal_to_employee_by_id.email,‘TSE Service Estimate’ +’ '+order_number,globals.Text5,null,null,new Array(attachment1));
if (!succes)
{
plugins.dialogs.showWarningDialog(‘Alert’,‘Failed to send email’,‘OK’);
}
} catch(theErr)
{
plugins.dialogs.showWarningDialog(‘Alert’,‘Failed to send email\nError:’ + theErr,‘OK’);
}
//print form option
var thePressedButton = plugins.dialogs.showQuestionDialog(‘Print Option’,‘Would you like to print a Service Estimate’,‘YES’,‘NO’)
if(thePressedButton == ‘YES’)
{
globals.Date3 = application.getTimeStamp();
controller.print(true);
}
var succes = plugins.mail.sendMail(globals.Text6,currentuserglobal_to_employee_by_id.email,‘TSE Service Estimate’ +’ '+order_number,globals.Text5,null,null,new Array(attachment1));
it is hard to debug!
try to do this:
var a = globals.Text6
var b = currentuserglobal_toemployee_by_id.email
var c = 'TSE… etc
and than: var succes = plugins.mail.sendMail(a,b,c, etc…
now you can check in the debugger if every field is filled in correctly!
Hope this helps