Mail plugin with pop3 support

Release notes for Servoy betas

Mail plugin with pop3 support

Postby Jan Blok » Tue Sep 07, 2004 3:19 pm

New mail plugin for Servoy 2.1
Steps to use new mail function:
-Place the plugin file in the plugin folder
-Start Servoy, open mail preference tab and specify pop3 server
-Open solution, create a method
-Move the sample code from recieveMail function in to the method
-fillin the correct username/password parameters in the call to recieveMail
-run the script
-view the output tab in the debugger (thats where application.output can be viewed)

Thanks to 'Stef Compeers' to for testing.

http://downloads.servoy.com/beta/2.1_product/mail.jar
Last edited by Jan Blok on Tue Oct 26, 2004 10:50 pm, edited 3 times in total.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby patrick » Tue Sep 07, 2004 3:37 pm

This is brilliant! This sort of saves my life messing around with those beans!!

Of course, I do have some wishes though:

1. could we have access to server settings (a user might have several accounts etc.) and pass them on to the plugin?
2. could we have a possibility to first get the number of messages and then retrieve one message (by index) instead of all? (If you leave messages on the server then you always transfer them all even if you just want to transfer the latest)

Related to that I'd have the request of sending mail from the client via user-definable accounts.

In our (non-Servoy) application users were able to configure as many email accounts as they want and use one of them for sending and any or all of them for receiving. I need to get this working in Servoy and had lots of trouble with beans (at least the pop3 beans). And now we are very close to what I need...

Thanks for the great effort and responsiveness regarding this issue!
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby IT2Be » Tue Sep 07, 2004 3:55 pm

GREAT stuff. Work like a charm!

Beware though. Dont' make the same mistake I did you have to provide the method with an account name NOT a complete mail adress :oops:
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby IT2Be » Tue Sep 07, 2004 3:57 pm

I think the checking on duplicate stored mail can be done with the id: Message-id=<000101c49374$4c663d15$e87dbb49@aactive.com>.

But then again if you want to check the header you also need to load the header...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby Stef » Tue Sep 07, 2004 4:21 pm

Thanks Jan!
This is great!

would be great to have
var msgs = plugins.mail.recieveMail('login', 'pasword', 'incoming mail server', true);

TIA
Stef
Stef
 
Posts: 208
Joined: Wed May 28, 2003 2:19 pm
Location: Kasterlee, Belgium

Postby patrick » Tue Sep 07, 2004 4:47 pm

IT2BE: Yes I know (about the message ID), the problem is this:

Let's say you leave messages on the server. Let's say you have 100 messages with attachments and so on. Now you want to retrieve the new messages.

With the plugin now you will have to retrieve all 100 messages (including attachments and all) to be able to figure out that 97 of those you already had... You see the point?

What I would like to do is this:

Code: Select all
plugins.mail.openConnection(server, port, user, pass); // establishes a connection to a given server
var no_mails = plugins.mail.getNoOfMessages(); // returns the number of messages on the server
var messageIds = plugins.mail.getMessageUIDs();  // returns an array of message IDs
var message = plugins.mail.getMessage(index int/message ID); // retrieves one message either for a given message index or a message ID
plugins.mail.closeConnection(); // closes the connection


Very useful is also something like plugins.mail.getHeader(index int/message ID). With this you might have a possibility to not completely retrieve a message. Imagine you work over a slow line and don't want to download attachments. With header info you could be able to see the size of a message and implement an option to not fully retrieve mails larger than xxx KB.

This would be perfect!!

Is this possible??
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby IT2Be » Tue Sep 07, 2004 4:52 pm

you tell it like I couln't get it from my brain to the screen...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Postby patrick » Tue Sep 07, 2004 5:18 pm

huh?
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Harjo » Tue Sep 07, 2004 6:47 pm

New mail plugin for Servoy 2.1

REALLY, REALLY WONDERFULL!! :D



would be great to have
var msgs = plugins.mail.recieveMail('login', 'pasword', 'incoming mail server', true);


Is it possible? We have a seperate pop3-box for every user!

Jan can you tell us a bit more, of the way it works? Is the mail now downloaded on the server and send to the clients?
Or is the mail downloaded right on the client itself?
Harjo
 
Posts: 4321
Joined: Fri Apr 25, 2003 11:42 pm
Location: DEN HAM OV, The Netherlands

Postby patrick » Tue Sep 07, 2004 6:57 pm

looks like it is downloaded on the client.

Just noticed some problem: I get rather often a null for getHtmlMsg() and getPlainMsg(). Could there be a problem with text coding or something? The messages that have that problem display just fine in Outlook...
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Jan Blok » Tue Sep 07, 2004 7:28 pm

HJK wrote:We have a seperate pop3-box for every user!

We are working on a version which support:
recieveMail(userName,password,leaveMsgsOnServer,[recieveMode],[onlyRecieveMsgWithRecieveDate],[overridePreferencePOP3Host])

HJK wrote:tell us a bit more, of the way it works?

The mail plugin exist of 2 parts clientplugin/serverplugin+libs, the client downloads the 38K client plugin
Client does always a call to the server (plugin) and the server code makes the connection to smtp/pop3 server analizes the data get from the smpt/pop3 and sent a reponse to the client.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby Jan Blok » Tue Sep 07, 2004 7:32 pm

patrick wrote:Just noticed some problem: I get rather often a null for getHtmlMsg() and getPlainMsg(). Could there be a problem with text coding or something? The messages that have that problem display just fine in Outlook...

I wonder how thats possible, the bodyparts in a mail have mimetype "text/html" or "text/plain" the plugin sets the according field in the MailMessage received, all other mimetypes become attachements.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby patrick » Tue Sep 07, 2004 7:39 pm

This is probably where my messages end up: in the attachments. I will investigate this further.

I just noticed that in the debugger most of my messages had no body although they do. I supposed that they are some kind of a mixed mime/type that Outlook perfectly displays.

I had similar problems before with beans. Most of the messages that gave me trouble there came from Apple Mail...
patrick
 
Posts: 3703
Joined: Wed Jun 11, 2003 10:33 am
Location: Munich, Germany

Postby Jan Blok » Tue Sep 07, 2004 10:47 pm

http://downloads.servoy.com/beta/2.1_product/mail.jar

enhanced version containing several requests:
the method does now look like:
recieveMail(userName,password,leaveMsgsOnServer,[recieveMode],[onlyRecieveMsgWithRecieveDate],[overridePreferencePOP3Host])

see the sample code for usage
Last edited by Jan Blok on Wed Sep 08, 2004 12:48 am, edited 1 time in total.
Jan Blok
Servoy
Jan Blok
 
Posts: 2684
Joined: Mon Jun 23, 2003 11:15 am
Location: Amsterdam

Postby IT2Be » Tue Sep 07, 2004 10:56 pm

IN one word... WOW...
Marcel J.G. Trapman (IT2BE)
SAN partner - Freelance Java and Servoy
Servoy Components - IT2BE Plug-ins and Beans for Servoy
ServoyForge - Open Source Components for Servoy
User avatar
IT2Be
Servoy Expert
 
Posts: 4766
Joined: Tue Oct 14, 2003 7:09 pm
Location: Germany

Next

Return to Latest Releases

Who is online

Users browsing this forum: No registered users and 10 guests