如何使用PHP构建基于Web的电子邮件客户端? [英] How do you build a web based email client using PHP?

查看:328
本文介绍了如何使用PHP构建基于Web的电子邮件客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想学习如何用PHP(类似于yahoo和gmail)构建基于Web的电子邮件客户端.

I would like to learn how to build a web-based email client in PHP (similar to yahoo and gmail).

有人知道我该如何开始吗?

Does anyone know how I can get started with this?

我希望我的系统能够发送和接收电子邮件.

I would like my system to be able to send and receive email.

推荐答案

最明显的答案是"不要":已经有很多网络邮件软件,其中一些基于PHP. (如果您依赖使用PHP,例如因为您已经有一个基于LAMP堆栈的服务器).

Most obvious answer would be "don't" : there are already lots of webmail software, some of which are PHP-based (if you depend on using PHP, because you already have a server based on a LAMP stack, for instance).

仅引用一些基于PHP的名称,您可以看看这些名称:

To quote only a few names, all PHP-based, you could have a look at these ones :

  • SquirrelMail :这是一个相当古老的版本,并不是很性感.多年
  • Horde IMP :众所周知,而且功能强大
  • roundcube :也许是我尝试过的列表中最性感"和"web 2.0"的地方
  • AtMail :我从没用过,所以我不能说更多...
  • SquirrelMail : a quite old-one, and not really sexy... But has been doing the job for years
  • Horde IMP : well-know too, and quite powerful
  • roundcube : maybe the most "sexy" and "web 2.0" of the list of those I tried
  • AtMail : I've never used this one, so I can't say much more...

我已经使用列表的前三名已经有一段时间了;我想说,roundcube绝对是"用户友好"中最重要的.

I've used the three firsts of the list for quite some time ; roundcube was definitly the most "user-friendly", I'd say...

(使用Google搜索,您可能会发现更多内容-但我想我说的是最常用的内容)

现在,如果您必须设置网络邮件,例如,为您的公司:明确使用某些现有软件:

Now, if you have to set up a Webmail, say, for you company : definitly use some already existing software :

  • 现有软件已经相当"":
    • 许多人在使用它,这意味着许多人说"这可以做得更好"或"那不是用户友好的",或者...你明白了;所有这些使现有软件变得更好:-)
    • 许多人将试图破坏这样的应用程序-这意味着很多安全修复程序,这意味着该应用程序可能比您长时间编写的应用程序更安全...
    • an existing software would be quite "good" already :
      • many people using it, which means many people who said "this could be done better", or "that is not user-friendly", or... you get the point ; all this made the existing software better :-)
      • many people will have tried to break such an application -- which means lots of security-fixes, which means an application probably more secure than you'll write in a long time...
      • 您真的准备好将这种时间花在处理已经存在的事物上吗?
      • 如果您在一家公司工作:您的公司准备好为您支付一年的费用吗? 甚至可能更多?正在处理已经存在的东西?
      • 你不相信我吗?阅读此博客文章:代码:琐碎;这是关于stackoverflow的,但是对于Webmail软件来说将是完全一样的(除了stackoverflow是较新的-且代码贡献者可能更少;但这只是一个疯狂的猜测^^ )
      • are you really ready to spend that kind of amount of time working on something that already exists ?
      • if you're working for a company : is your company ready to pay your for one year ? or even probably more ? working on something that already exists ?
      • you don't believe me ? Read this blog-post : Code: It's Trivial ; it's about stackoverflow, but it would be exactly the same for a webmail software (except that stackoverflow is more recent -- and probably had less code-contributors ; but that's just a wild guess ^^ )

      作为旁注:如果您的公司希望您构建gmail克隆,则您不会(同一件事:有多少人从事gmail工作?您的公司有多少程序员?您的公司可以有多少?花这个吗?) ...
      您每年只需花几美元,您的公司就可以为每个员工雇用一个"专业" Google帐户,顺便说一句...

      As a sidenote : if your company wants you to build a clone of gmail, you won't (same thing : how many people worked on gmail ? How many programmers does your company have ? How much can your company spend on this ? )...
      And for just a couple dollars each year, your company could have a "professionnal" Google account for each one of it's employes, btw...

      毕竟,如果您仍然想/必须使用LA *(M)* P堆栈编写自定义的手工网络邮件,则至少需要了解以下内容:

      After all this, if you still want to / have to write a custom hand-made webmail using a LA*(M)*P stack, you will need to know at least the following :

      • 如何用PHP编程
      • IMAP 的基础(即使您使用库/框架,如此大的应用程序也将需要您了解一些有关底层协议的知识,或者永远不会理解为什么"或如何"某事出了错)
      • HTML/CSS/Javascript (了解AJax的知识-来吧,是2009年!)
      • 因此,您的应用程序更易于维护(并且可以添加/修改/修改内容并纠正错误),您可能需要使用某些Framework,并遵循一些设计模式和最佳实践
        • 作为示例,您可以看看 symfony Zend Framework
        • 是的,您可以在没有框架和/或没有MVC的情况下进行开发和应用...但是.. ergh ...
        • How to programm in PHP
        • The basics of IMAP (even if you use a library / framework, such a big application will require you to know some stuff about the underlying protocols, or won't ever understand "why" or "how" something went wrong)
        • HTML / CSS / Javascript (with some knowledge of AJax -- come on, it's 2009 !)
        • So your application is easier to maintain (and adding/reworking/modifying stuff and correcting bugs is possible), you will probably want to use some Framework, and follow some design patterns and best practices
          • As an example, you can take a look at Frameworks like symfony, or Zend Framework
          • Yes, you can develop and application without a Framework, and/or without MVC... But.. ergh...

          考虑所有这一切都不是问题((如果您已经不那么擅长于此,并且/或者没有太多经验,那么可能至少需要花费几年的时间...考虑到编程和网络开发是您的全职工作),您可以开始使用IMAP等方式来访问邮件服务器.

          Considering all this is not a problem (If you are not quite good at all this already, and/or don't have much experience, it could take at least a couple of years to acquire that... Considering programming and web-developping is your full-time activity), you can start tkinking about accessing a mail server using, for instance, IMAP.

          这里有几种可能性.
          至少在选择这两个之前,我会先看看:

          There are several possibilities here.
          I would have a look, at least, before choosing, at these two :

          应用程序完成后,您将(希望如此!)开始获取用户,这至少意味着三件事:

          Once your application is quite done, you will (hopefully !) start getting users, which means at least three things :

          • 错误报告;对于用户而言,这些几乎总是紧急 -例如" OMG,我不明白什么都行不通了,我现在就收到我的邮件!"
          • 不断发展的需求:用户总是想要更多类似""的东西,例如我在个人帐户的gmail中看到的;我们的公司帐户又如何呢?这是我们用来工作的工具! "
          • "这太慢了,我不能工作!";然后,请祈祷您在设计/开发应用程序时考虑了可伸缩性和优化!
          • Bug-reports ; those are almost always urgent for users -- like "OMG I don't understand nothing works anymore, I gotta get my mail RIGHT NOW!"
          • Requests for evolutions : users always want more stuff like "I saw that in gmail on my personnal account ; how is it we don't have that too with our corporate account ? It's the tool we use to work !"
          • "This is too slow, I can't work !" ; then, pray you thought about scalability and optimization when you designed/developped the application !

          再一次,您准备好处理了吗?

          Here, again, are you ready to deal with that ?

          嗯,我想我已经说够了;现在,您该考虑一下:您真的要/需要从头开始开发这样的应用程序吗?

          Well, I think I said enough ; now, it's your time to think : do you really want/need to develop such an application from scratch ?

          如果您有一点空闲时间,也许您可以参加一个已经存在的开源项目?这可能对每个人都有利;-)

          If you have a bit of free time, maybe you could participate in an already existing, open-source, project ? That could be profitable to every one ;-)


          最后,最后一件事:如果您只是想做一个有趣的项目,想知道它是什么样的,并了解有关Web开发的更多信息,那就做吧!
          (在我看来,这可能是唯一有理由进行这项工作的原因,顺便说一句)


          Finally, one last thing : if you want to work on such a project just for fun, to know what it's like, and to learn more about web-development, then DO !
          (It's, in my opinion, probably the only reason that would justify working on this, btw)


          无论如何,祝你好运!和/或玩得开心!


          Anyway, good luck ! And/or have fun !

          这篇关于如何使用PHP构建基于Web的电子邮件客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆