Thanks!
I will test that in a minute. How about that java.lang.classCastException that I get when passing header.getSentDate()?
Thanks!
I will test that in a minute. How about that java.lang.classCastException that I get when passing header.getSentDate()?
I forgot to ask, could you sent me the .log.txt when this happens?
Now I always get “null” when I do
var headers = plugins.mail.recieveMail(userName, userPass, true , 1 , null, hostname);
??
and the log says
java.lang.NullPointerExceptionjava.lang.NullPointerException
at com.servoy.r2.plugins.mail.MailServerUtils.createAddressString(MailServerUtils.java:133)
at com.servoy.r2.plugins.mail.MailServerUtils.createMailMessage(MailServerUtils.java:38)
at com.servoy.r2.plugins.mail.MailServer.recieveMail(MailServer.java:213)
at com.servoy.r2.plugins.mail.MailProvider.js_recieveMail(MailProvider.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:289)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1237)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.n.a(Unknown Source)
at com.servoy.j2db.develop.debugger.n.access$14(Unknown Source)
at com.servoy.j2db.develop.debugger.n$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Hi Jan
Downloaded latest version of Mail Plugin - your post 17 Sep 1.32pm - but cannot get started.
Trying to test by downloading first few messages but after a short delay [msgs] always returns null.
//Recieve mails from pop3 account
var msgs = plugins.mail.recieveMail(‘ztvo0afzzzzz’, ‘WnKN2rB7Xzzzzz’, true);
if (msgs != null) //if is null error occurred!
{
// for (var i = 0 ; i < msgs.length ; i++)
for (var i = 0 ; i <=6 ; i++)
{
var msg = msgs
------------------------------------------
Have tried with two different mail accounts/providers.
Servoy Developer
Version R2 2.1-build 310
Java version 1.4.2-38 (Mac OS X)
I am getting inconsistent results, too.
I am using office accounts where I know that mails are waiting for collection to test.
I can get mail from one account but not the other five that I have tried.
I have ‘null’ returned for ‘msgs’ in those instances.
I have used the sample code which does work fine on the account which responds and which shows the output correctly as I step through the method !
Cheers
Harry
Sorry should have included:
Servoy Developer
Version R2 2.1-build 310
Java version 1.4.1_03-b02 (Windows XP)
Like Harry I am checking accounts where I know there are plenty of messages although they will have been read by Outlook - does this set a flag that’s triggering the ‘null’ return??
GrahamG
I know that the messages that I can see have NOT been read.
I have sent the messages to the target accounts myself and attempted to read them with the mail PlugIn before the mail clients have accessed them !
Also the mail clients of target test accounts are set to delete the messages from the server once downloaded - so the messages up there should be virgin messages anyway !
‘Curiouser and curiouser’, said Alice !
Harry
patrick:
Now I always get “null” when I do
It seems the cc header is not present at all when empty on some mailserver, fixed: http://downloads.servoy.com/beta/2.1_product/mail.jar
I have a few questions about the pop3 plugin:
1.) I have a method that only downloads the headers. That is working fine.
Now i have the following method, that must only download the current mail:
var recieveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS
var msgs = plugins.mail.recieveMail(p_username, p_password, true,recieveMode, senddate);
senddate is a column with the Senddate in it.
But I’ll get the following error:
java.lang.ArrayIndexOutOfBoundsException
What am I doing wrong?
2.) When I do this: (sample code)
var attachments = msg.getAttachments()
if (attachments != null)
{
for (var j = 0 ; j < attachments.length ; j++)
{
var attachment = attachments[j]
//application.output(attachment.getName())
var attachmentDataByteArray = attachment.getData()
//write attachmentDataByteArray to a file...
}
}
Does that mean, that when I do this in a client, that an attachment of about 4MB, is first downloaded to (the client) variable: attachments and if I put it in the database, is the whole 4mb uploaded again??
In (for example) Outlook there is a function, that you can keep messages on the server for let’s say: 20 days.
Is this standard email-functionality, or is it something that only Outlook does?
Jan, you said that there was no unique emailnumber. In almost all the pop3 beans you find something like this:
elements.bean_680.getMessageUID(number) or
elements.bean_680.getNoOfMessage()
Now we have to download always all the headers, to determe how many emails there are, en determe which emails must be downloaded.
If there are 20 message, this is not a problem, but if there are 100, this is a problem.
A customer of us is using pop3/imap server. The imap-server is reachable by a webbrowser too. So if we do a pop3 session, we must leave the message on the server, because else the message would not be seen in the (imap) webbrowser.
Is there an easier (less overhead) way to do this?
5.) In the debugger I see also function, like: notify and notifyAll
What does that do?
6.) Why is the getReceivedDate() always empty?? (returning null)
6.) Oke, but why is there a function: msg.getReceivedDate() ?
You don’t have to answer!
It is availible on the java objects so we forwarded them to javascript, maybe in the future the recieve date is filled in
An performance enhancement is made for headers only http://downloads.servoy.com/beta/2.1_product/mail.jar
Thanks to HJK for pointing this out.
I am still getting “null” and in the log I see this error when retrieving mail:
java.lang.NullPointerExceptionjava.lang.NullPointerException
at com.servoy.r2.plugins.mail.MailServerUtils.createAddressString(MailServerUtils.java:133)
at com.servoy.r2.plugins.mail.MailServerUtils.createMailMessage(MailServerUtils.java:38)
at com.servoy.r2.plugins.mail.MailServer.recieveMail(MailServer.java:213)
at com.servoy.r2.plugins.mail.MailProvider.js_recieveMail(MailProvider.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:289)
at org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:1237)
at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:1940)
at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:94)
at com.servoy.j2db.scripting.e.call(Unknown Source)
at com.servoy.j2db.develop.debugger.n.a(Unknown Source)
at com.servoy.j2db.develop.debugger.n.access$14(Unknown Source)
at com.servoy.j2db.develop.debugger.n$3.run(Unknown Source)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
the download doesn’t work anymore.
Does anyone know a miror for downloading this plugin ?
Sorry we forgot to post here, it is now included in Servoy 2.1.1.
See http://forum.servoy.com/viewtopic.php?t=3014