如何在没有服务器的情况下编写电子邮件客户端?

发布于 2024-11-06 03:38:02 字数 166 浏览 0 评论 0原文

我想制作自己的电子邮件客户端。可能是 Gmail 的替代品,或者只是其自己的电子邮件服务。

我可以无需服务器创建自己的电子邮件服务吗?

有没有办法用 websocket 来做到这一点?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

转身以后 2024-11-13 03:38:02

您需要某种服务器来侦听电子邮件连接以接收邮件。

所以,是的,您需要某种服务(必须在服务器上运行)来侦听电子邮件。您可能需要首先了解 SMTP 电子邮件连接的工作原理

http://en.wikipedia.org/wiki/Simple_Mail_Transfer_Protocol

这应该向您展示每个邮件服务器发送和接收电子邮件的过程。

让我们也注意这里服务器的定义,您的监听服务需要在始终具有互联网连接的设备上运行。 (简单地说)

补充一下,你的问题有点误导。提供的答案应该会让您朝着正确的方向前进。

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.

金兰素衣 2024-11-13 03:38:02

您可以在没有电子邮件服务器的情况下制作电子邮件客户端(在线)。该电子邮件客户端将请求邮件服务器显示邮件。

但实际上,当用户登录您的界面时请求外部邮件服务器会非常慢。您必须在自己的服务器中缓存电子邮件数据并定期执行更新。这就是桌面客户端所做的事情。他们每隔几分钟检查一次邮件并将邮件存储在您的硬盘上,以便您可以随时查阅。

如果您提供网络电子邮件客户端,则必须在服务器端执行相同的操作,至少获取所有标头。最好是获得全部内容。

当你完成这些后...无论如何你已经拥有了几乎一个邮件服务器...

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...

过去的过去 2024-11-13 03:38:02

最终,电子邮件会像其他一切一样通过套接字,因此,对您的问题的简短回答是肯定的。

更长的答案是,您必须实现电子邮件协议的客户端部分,除了专有协议之外,这意味着 IMAP POPSMTP。尽管如此,您最终还是需要一个邮件服务器来测试您的客户端。

我希望这足以阻止您的这种尝试。市场上有如此多的电子邮件客户端:为什么还需要另一个呢?

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?

你是我的挚爱i 2024-11-13 03:38:02

取决于您的应用程序应该在哪里工作。您选择的标签并不真正适合在一起。

如果您创建 Java 应用程序,这没有问题。

如果您想创建像 gmail 这样的网络客户端,您的可能性是有限的,因为您无法创建实现 POP / IMAP / SMTP 协议所需的普通套接字连接。从 JavaScript 中,您只能打开依赖于 HTTP 协议的连接,无论它是 XMLHttpRequest 还是 WebSocket 连接。

注意:您还可以以小程序的形式将 Java 应用程序嵌入到网站中。但说实话,小程序已经很旧了,我不会在新的网络应用程序中使用它们。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文