I wanted to make my own email client. Something that could be an alternative for Gmail, or just its own email service.
Can I make my own email service without servers?
Is there a way to do this with websockets?
You would need some kind of Server listening for the email connection, to recieve mail.
So yes you would need some kind of service (Which would have to run on a server) to listen out for the email. You might need to look into how SMTP email connection works first
http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol
This should show you the process, each mail server goes through to send and recieve an email.
Lets be careful about the definition of a server here as well, your listening service will need to run on somthing that has an internet connection all the time. (Put simply)
Just to add, your question is a little miss-leading. The answers provided should put you in the right direction.
You can make an email client (be it online) without having an email server. This email client would request the mail server to display the mail.
But in pratice, requesting an external mail server when the user log into your interface will be really slow. You will have to cache email data in your own server and perform update on a regular basis. This is what desktop client do. They check mail every few minutes and store the mail on your hardrive so you can consult then anytime you want.
If you provide a web email client, you'll have to do the same on server side, at least getting all the headers. Best would be to get the whole content.
When you have done that... You already have nearly a mail server anyway...
Ultimately email goes through sockets, just as everything else, so, the short answer to your question is yes.
The longer answer is that you must implement the client-side part of email protocols, which, excluding proprietary ones, means IMAP, POP, SMTP. Nevertheless, you will ultimately need a mail server to test your client.
I hope this is enough to discourage you in this attempt. There are so many email clients out there: why do you want another one?
Depends on where your application should work. Your selected tags do not really fit together.
If you create a Java application, this is no problem.
If you want to create a web-client like gmail, your possibilities are limited, because you cannot create a normal socket connection, which would be needed to implement the POP / IMAP / SMTP protocols. From JavaScript you are only able to open connections that depend on the HTTP protocol, no matter if it is a XMLHttpRequest or a WebSocket connection.
Note: you can also embed a Java application in a website in form of an applet. But to be honest, applets are old and i wouldn´t use them in new web-apps.
精彩评论