我想这是两个紧密相连的问题。
相关问题讨论了如何使用pop3读取和解析电子邮件。我需要能够做到这一点,但是,我希望它能够与我需要的任何电子邮件地址一起使用。
我试图允许用户通过将内容通过电子邮件发送到唯一的电子邮件地址来提交内容,该地址将自动知道该内容应与哪个帐户关联。
有没有一种好方法可以在 C# 中动态创建这些电子邮件地址并检查这些电子邮件帐户以便提交内容?
或者,有没有办法创建一个“通配符”电子邮件帐户,将所有电子邮件发送到该域,并允许我查看收件人地址是什么?
I guess this is sort of two questions that are tied together.
Related questions have discussed how to read and parse email using pop3. I need to be able to do this, however, I want this to be able to work with any email address I need.
I am trying to allow users to submit content by emailing it to a unique email address, which will automatically know to which account the content should be associated.
Is there a good way to create these email addresses on the fly in C# and check these email accounts so for content submissions?
Alternatively is there a way to make a "wildcard" email account which gets all of the email sent to the domain and allows me to see what the to address was?
发布评论
评论(3)
大多数电子邮件服务器允许您将所有无法送达的电子邮件路由到特定邮箱(尽管如何执行此操作的详细信息取决于邮件服务器)。从那里,您应该能够从邮件的 To 标头获取发送到的地址。
Most email servers will allow you to route all undeliverable email to a specific mailbox (though the details on how to do it will depend on the mail server). From there you should be able to get the address it was sent to from the To header of the message.
更好的方法是完全跳过收件箱/POP 检查,让 MTA(消息传输代理)将传入电子邮件直接“发送”到您的应用程序。
以下是 PHP 的设置示例: http://www.evolt.org/incoming_mail_and_php
A much better method is to skip the inbox/POP-checking altogether and have your MTA (Message transfer agent) "send" incoming emails straight to your application.
Here's an example setup with PHP: http://www.evolt.org/incoming_mail_and_php
是的,它被称为catch all:
http://en.wikipedia.org/wiki/Catch-all< /a>
具体如何操作取决于您的域名托管服务商/您用来处理电子邮件的人员。
Yes its called catch all:
http://en.wikipedia.org/wiki/Catch-all
It depends on your domain host/who you are using to handle your email on the specifics of how to do it.