开发者

Creating email address via PHP or any other script

I need to create proxy email address for my users. The email addresses will look like user1234@domain.com but preferably I want better looking email addresses such as first.last@domain.com. Email is sent to this address should forward to the user's real email address that is not suspposed to be exposed (e.g. first.last@hotmail.com). There is no开发者_开发知识库 need to create a POP3 mailbox. Emails sent to regular email accounts (e.g. info@domain.com) should go to the correct POP3 mailbox. I would prefer a PHP+MySQL solution and I also want to avoid tampering with server configuration as much as possible.

I've seen such things on Facebook and Blogger. For example Blogger gives you an email address at which you can send emails and they become published as blog posts. Facebook gives you an email address at which you can send pictures (via cell phone) and they become published on your profile. Yahoo groups also give you an email address at which the sent emails are forwarded to subscribers.

So I need something similar only that I'll just forward the email to the real email address. I hope you get the point. Any help or guidance would be appreciated.


This is mostly just about configuring your MTA correctly. Indeed you can do it completely using the configuration options available in most MTAs - here's how to do it with sendmail.

If you want to funnel it through your own script make sure all the valid addresses were getting routed correctly then set the default recipient for the domain (since you don't mention what MTA you are using, or even which OS it runs on, I can't guess how you do that) to forward to a handler script - all the handler script needs to do is to create a new email (don't try to forward the original) with the content (it'd be nice to include the original headers as an attachment to the new message).

Note that you'll need to put a new local address (@domain.com from your example) in the 'From'/'Reply-To' headers to avoid the message being classified as SPAM.

You really don't want to sink the emails on a local mailbox.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜