mail plugin

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.

John McCann
Windows XP
MS SQL

Hi can you provide us your method?

I had some troubles too sending emails, but they are fixed in 2.2.3.

(I noticed, if you have leading or trailing spaces in the emailadres, it wil fail also!)

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);
}

Any Ideas?

Erich

if you do this

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

Ok, I Think I figured it out,
I cannot send mail from myself,

but I can send it to myself from someone else, or to someone else from someone else.

Does that make any sense?

I have the same problem, cannot send mail anymore…

Servoy Developer
Version R2 2.2.2-build 334
Java version 1.4.2_05-b04 (Windows XP)

method:
var succes = plugins.mail.sendMail(‘stef@willcom.be’, ‘jack@sssm.be’, ‘subject’, ‘aaa’)

Error shown:
SMTPSend java.lang.StringIndexOutOfBoundsException: String index out of range: -

Help!

TIA
Stef

Stef, this was indeed an error in 2.2.2
update to 2.2.3 and it will be fixed!

Thanks, Harjo…and shame on me!

Best regards,
Stef

My problems with email went away in version 2.2.3

John McCann

MS SQL Server
Windows XP