|
|
Home » Developing U++ » UppHub » WebMail package (POP/SMPT/IMAP)
WebMail package (POP/SMPT/IMAP) [message #18316] |
Mon, 22 September 2008 17:05  |
Oblivion
Messages: 1202 Registered: August 2007
|
Senior Contributor |
|
|
Hi,
I am working on a WebMail package, which will include the below classes:
MailSocket (actually, this class is created with the U++ SmtpMail code)
EMail
POP3Mail
SMTPMail (I know there is already a SmtpMail, but I found it hardly useful).
IMAP
Althoug the WebMail package is under heavy development, I would like to upload the source code here, for I will not add this class to the SVN until it becomes fully productive.
Currently, only the POP3Mail class is complete (has APOP) and EMail class can only parse plain text mails (other MIME types will be supported with a MIMEParser, but it's another story.
I've created a simple multihreading POP3 mail reader example, which I hope will give you an idea what can be done.
I would like to know your opinions. Also any feedbacks, help and criticisms are apperciated.
Regards.
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Wed, 24 September 2008 01:33] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: WebMail package (POP/SMPT/IMAP) [message #18349 is a reply to message #18344] |
Wed, 24 September 2008 01:33   |
Oblivion
Messages: 1202 Registered: August 2007
|
Senior Contributor |
|
|
Mindtraveller wrote on Tue, 23 September 2008 21:56 | I`ve just tried your MailReader application. It managed to read all the headers from my mail account by POP3 protocol:
Quote: | +OK
USER ************
+OK Password required for user ********
PASS ************
+OK ************* maildrop has 133 messages (155829248 octets)
STAT
+OK 133 155829248
LIST
UIDL
QUIT
+OK POP3 server at ******* signing off
| Everything worked if I tick "Transcript" ckeckbox (no idea what that means). Without "Transcript" checked program fails to connect to server (no debug info shown) with GPF exception from time to time.
U++: latest SVN build
OS: WinXP SP2
|
Yes, you're right. I've changed the "transcript" to "enable logging". I hope this makes sense. As to the General page fault you mention, I've updated the code. It should be fixed now...
I would be grateful if you could test the new source.
Forlano wrote on Mon, 22 September 2008 22:44 |
The timed out error disappeared after I used the correct IP Embarassed , but no emails were retrieved. Tested with MSC9 with the same null result.
I saw that it is difficult (impossible) to exit the program when it is running and the program crush if I press two times read email.
|
Yes, it is because the socket is currently in blocking mode. I am going to make it a nonblocking socket but, frankly, I'm a little bit troubled with U++ Socket class since there is no documentation about it. Neither the MT forum topics nor the Httpcli/srv examples helped me much... If possible, I don't want to rewrite the whole code in pure Win32 and X11, so can someone briefly explain the necessary steps to be taken in creating nonblocking sockets with U++? Also, how can I use that SocketEvent class (which seems to be defined only under Win32)?
captainc wrote on Mon, 22 September 2008 23:08 |
What are your plans for this? It would be great to work with a single Upp SSL package that could be used for many things like web, ftp, mail, etc... Or will they all be specific implementations anyway?
|
Well It's really a good idea to have a single SSL wrapper. But it also might be very time consuming. OTOH, I can give it a try (but I have a lot of things waiting to be finished on my TODO list.That's why I wrote "not yet". The WCS classes and this WebMail package is on top of my list now. But again, it is worth trying).
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
|
|
|
|
Re: WebMail package (POP/SMPT/IMAP) [message #20841 is a reply to message #18316] |
Mon, 13 April 2009 19:41   |
Sc0rch
Messages: 99 Registered: February 2008 Location: Russia, Rubtsovsk
|
Member |

|
|
What about smtp? I'll need to send a simple mail with one or two files. So I'm thinking about the more simple and fast variants. Can you help me with a simple code-snippet or advice?
It will be great, if you could show a "conversation" with the socket, it will help to realize how to send a mail with attachments successfully. And I don't know much more about MIME format, and about free tools for it, >_<.
And I'm going to search the answers myself too, yeh, of cause.
Best regards, great man, and sorry for my English,
Anton.
|
|
|
Re: WebMail package (POP/SMPT/IMAP) [message #20844 is a reply to message #20841] |
Mon, 13 April 2009 23:57   |
Oblivion
Messages: 1202 Registered: August 2007
|
Senior Contributor |
|
|
Quote: |
What about smtp? I'll need to send a simple mail with one or two files. So I'm thinking about the more simple and fast variants. Can you help me with a simple code-snippet or advice?
It will be great, if you could show a "conversation" with the socket, it will help to realize how to send a mail with attachments successfully. And I don't know much more about MIME format, and about free tools for it, >_<.
And I'm going to search the answers myself too, yeh, of cause.
Best regards, great man, and sorry for my English,
Anton.
|
Hello Anton,
Actually, the code of this "yet-to-be-finished" (I'm sorry, I'm way too busy nowadays... I didn't have the time to finish it) class is based upon the original U++ SmtpMail class. So you should check "SMTPMail::Send()" method in Web/smtp.h. It will give you an idea about the socket "transaction" (or conversation, if you will). It works almost like my unfinished POP3Mail class.
Smtp example code should be something like this:
#ifndef _SmtpExample_SmtpExample_h
#define _SmtpExample_SmtpExample_h
#include <CtrlLib/CtrlLib.h>
#include <Web/Web.h>
using namespace Upp;
#define LAYOUTFILE <SmtpExample/SmtpExample.lay>
#include <CtrlCore/lay.h>
class SmtpExample : public WithSmtpExampleLayout<TopWindow> {
public:
typedef SmtpExample CLASSNAME;
SmtpExample();
SmtpMail smtp;
void Send();
};
SmtpExample::SmtpExample()
{
CtrlLayout(*this, "Smtp Example");
smtp.Transcript();
smtp.Subject("Smtp Example");
smtp.Port(25);
smtp.Host("smtp.host.com");
smtp.Auth("username", "password");
smtp.From("from");
smtp.To("to");
smtp.AttachFile("filename", mimetype = 0);
SendButton << THISBACK(Send);
}
void SmtpExample::Send()
{
smtp.Send();
LogConsole.Set(smtp.GetTranscript());
}
GUI_APP_MAIN
{
SmtpExample().Run();
}
But beware, this code probably won't work; because most of the servers require at least a TLS encryption/session after the first "HELO" message.
For more information on SMTP protocol you should read RFC 821 and RFC 5321.
You can read and search POP3/SMTP/MIME/TLS/SLL etc. RFC documents at:
http://www.rfc-editor.org/rfcsearch.html
I hope that this will give you an idea on where to start.
Regards.
Oblivion
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Tue, 14 April 2009 00:01] Report message to a moderator
|
|
|
|
Re: WebMail package (POP/SMPT/IMAP) [message #28245 is a reply to message #18316] |
Wed, 25 August 2010 09:01   |
|
Hello!
What news about POP/SMPT/IMAP?
Is it the latest version?
If not where can I download the latest version?
I'm interested in this and want to test and improve if will need.
Thank you in advance!
Ion.
Oblivion wrote on Mon, 22 September 2008 18:05 | Hi,
I am working on a WebMail package, which will include the below classes:
MailSocket (actually, this class is created with the U++ SmtpMail code)
EMail
POP3Mail
SMTPMail (I know there is already a SmtpMail, but I found it hardly useful).
IMAP
Althoug the WebMail package is under heavy development, I would like to upload the source code here, for I will not add this class to the SVN until it becomes fully productive.
Currently, only the POP3Mail class is complete (has APOP) and EMail class can only parse plain text mails (other MIME types will be supported with a MIMEParser, but it's another story.
I've created a simple multihreading POP3 mail reader example, which I hope will give you an idea what can be done.
I would like to know your opinions. Also any feedbacks, help and criticisms are apperciated.
Regards.
|
[Updated on: Wed, 25 August 2010 09:01] Report message to a moderator
|
|
|
Re: WebMail package (POP/SMPT/IMAP) [message #28282 is a reply to message #28245] |
Wed, 25 August 2010 16:53  |
Oblivion
Messages: 1202 Registered: August 2007
|
Senior Contributor |
|
|
tojocky wrote on Wed, 25 August 2010 10:01 | Hello!
What news about POP/SMPT/IMAP?
Is it the latest version?
If not where can I download the latest version?
I'm interested in this and want to test and improve if will need.
Thank you in advance!
Ion.
Oblivion wrote on Mon, 22 September 2008 18:05 | Hi,
I am working on a WebMail package, which will include the below classes:
MailSocket (actually, this class is created with the U++ SmtpMail code)
EMail
POP3Mail
SMTPMail (I know there is already a SmtpMail, but I found it hardly useful).
IMAP
Althoug the WebMail package is under heavy development, I would like to upload the source code here, for I will not add this class to the SVN until it becomes fully productive.
Currently, only the POP3Mail class is complete (has APOP) and EMail class can only parse plain text mails (other MIME types will be supported with a MIMEParser, but it's another story.
I've created a simple multihreading POP3 mail reader example, which I hope will give you an idea what can be done.
I would like to know your opinions. Also any feedbacks, help and criticisms are apperciated.
Regards.
|
|
Hello tojocky
Unfortunately, I have no spare time to develop this project all by myself (I have a job, and a PhD thesis to complete). But if someone will volunteer to takes over this project or help me, I will gladly help him and contribute to it 
Recently I have added a basic and simple SSL & TLS support to the MailSocket class, and it seems to be working fine. Please feel free to modify, improve and maintain the package. If you would like to further develop WebMail class, there are some points you should know:
1. MailSocket class is a blocking socket and it should be made nonblocking.
2. POP3Mail class is almost complete. But, as always, it could be improved.
3. EMail parser class is only a scratch. It needs to be developed.
4. There is no SMTPMail class yet, but once MailSocket class is complete (made nonblocking), it should be relatively easy to create one.
One more thing: Since WebMail has basic SSL/TLS support, you will need OpenSSL packages to get the package compiled.
On Windows, you can download it from http://www.openssl.org
On Linux (on *buntu distros, at least), you should install "libssl-dev" package.
Regards
Github page: https://github.com/ismail-yilmaz
upp-components: https://github.com/ismail-yilmaz/upp-components
Bobcat the terminal emulator: https://github.com/ismail-yilmaz/Bobcat
[Updated on: Wed, 25 August 2010 16:55] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:21:03 CEST 2025
Total time taken to generate the page: 0.01203 seconds
|
|
|