如何为Web应用程序实现电子邮件保管箱功能?

chi*_*pum 8 email-integration web-applications

您可能已经看到过具有"电子邮件保管箱"的网络应用.用户可以发送电子邮件到"dropbox@123232.wepapp.com"等特殊地址,邮件将被解析并作为评论,待办事项等插入其帐户.

我们正试图建立这样的东西,并想知道哪种方式最好?'dropbox@123232.wepapp.com'是实际定义的电子邮件帐户还是别名?或者它既不是,他们使用一个包罗万象的电子邮件帐户,然后只需解析"收件人"地址,以确定与之关联的帐户?它是否也是一个名为"dropbox"的已定义电子邮箱,因为它们使用动态子域,所有电子邮件都会传递到一个大收件箱,然后根据邮件"收件人"地址进行解析?

And*_*mer 9

我建议使用帐户子域的通配符别名创建一个捕获所有电子邮件地址.DropBox@*.yourdomain.com

子域是邮件服务器中的别名,它指向电子邮件服务器DropBox@yourdomain.com上的实际帐户.

Then users can send emails to something like DropBox@myusername.yourdomain.com which will be parsed by the alias and routed to the physical email address.

Then you can create a service that pulls out all the received emails, parses the subdomain (which directly corresponds to the recipient accounts username) and parse the body of the email which is then pushed into your commenting or messaging system.

This usually works quite well and is actually really easy to implement.

Update: I started to write a 3 part series on DotNetSlackers.com to specifically address this topic. It covers the set up and configuration of the email server, the code to connect to the pop server from C#, and the processing that has to occur to handle the mail that comes in. It is wrapped up by putting all of this functionality into a windows service so that the tool works on its own (as well as logging out to the file system). Let me know if the articles don't cover something! (The first one is up now. The other two are submitted with the second one being made public 7/29/2009. The third one should be released the following week.)

http://dotnetslackers.com/articles/aspnet/Creating-a-Dynamic-Email-Drop-Box-Part1.aspx