Can anyone provide guidance on getting the Elegent POP3 bean to work with Servoy ??
Using Matt Petrowski’s great tutorial - http://forum.servoy.com/viewtopic.php?t=1408 - I have the SMTP bean working fine but just can’t work out how to control the POP version.
var m = elements.bean_296
m.hostName = 'your.provider.com'
m.userName = 'youraccountname'
m.password = 'yourpassword'
m.port = 110
m.openConnection()
var a = m.getNoOfMessage()
var c = m.getMail(a)
var a = returning: 1 //that is correct, there is one email in my emailbox
var c = returning: null //that one I don’t get!
Could someone help us a bit?
for example how do we get the subject, body etc..
I see all those codes in de API-docs but I can’t see or reach them in Servoy in the bean!
var num_messages = m.getNoOfMessage() // this will give you the number of messages
for ( var i = 1 ; i <= messages ; i++ )
{
var a_message = pop.getMail(i); // will return a message object of message i
parseMessage(a_message);
}
and then in parseMessage() you can do this
var m = arguments[0];
var m_to = m.getTO();
var m_from = m.getFrom();
and so on..,
getMail will return a message object. This object has lots of methods and attributes that you can “play” with…
I have done a very nice pop3 client with this bean, but I do have a problem when message are “big” (more than a few KB). Johan did some investigation on this and came to the same result, but has no closer insight (yet) to the issue. If anyone else has that problem, please let me know so we can get this working.
I have tried some other bean package with a tremendous feature set (you can, for example, retrieve single message parts etc.). This bean works perfectly for receving mails.
When sending mails, however, the SMTP bean expects a message object to be send. The problem now is that I don’t have access to a message bean (it just doesn’t show up). I suppose this is because Servoy only supports “interface beans”? When retrieving mails this problem does not occur because the POP3 bean returns a message object. Is there anything we can do about this or that I can tell the developers?
should have returned the last message. If you get a null there once, you are out of business…
This is what Johan wrote to me:
hmm if i dig a bit deeper into the component then yes if the size is large then the pop bean just doesn’t return a message.
I will try to test it in pure java for you but i think this is somehow a limitation of that bean
Actually I don’t think it’s a bug. The guys have lots of functionality around attachments, so I guess they tested that one… Maybe some strange problem that just occurs when you use the bean inside Servoy…