Hi all,
If I try the following as a script
global_k9_subj=substring(k9_subject, 0,35);
I run into an error message. Not always but pretty often. Wonder if there is an error in my script or some subjects have "strange" characters.
Regards
Christian
K9_subject error
Moderator: Martin
Re: K9_subject error
Hi,
What's the error message in the log (menu->Manage->Log)?
Perhaps you get mails with a subject that's shorter than 35 characters. The substring function will throw an exception in this case (StringIndexOutOfBoundsException).
You can either check the length of the string on your own before passing 35 to the function or call the function left which will check the length of the string:
global_k9_subj=left(k9_subject, 35);
Regards,
Martin
What's the error message in the log (menu->Manage->Log)?
Perhaps you get mails with a subject that's shorter than 35 characters. The substring function will throw an exception in this case (StringIndexOutOfBoundsException).
You can either check the length of the string on your own before passing 35 to the function or call the function left which will check the length of the string:
global_k9_subj=left(k9_subject, 35);
Regards,
Martin