通过PHP或任何其他脚本创建电子邮件地址 [英] Creating email address via PHP or any other script

查看:168
本文介绍了通过PHP或任何其他脚本创建电子邮件地址的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为我的用户创建代理电子邮件地址。电子邮件地址看起来像 user1234@domain.com ,但最好我想要更好的电子邮件地址,例如 first.last@domain.com 。电子邮件将发送到该地址,转发给用户未被挂起的实际电子邮件地址(例如 first.last@hotmail.com )。没有必要创建POP3邮箱。发送到常规电子邮件帐户(例如 info@domain.com )的电子邮件应该转到正确的POP3邮箱。我更喜欢PHP + MySQL解决方案,我也希望尽可能避免篡改服务器配置。

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.

我在Facebook和Blogger上看到过这样的事情。例如,Blogger给您一个电子邮件地址,您可以在其中发送电子邮件,并将其作为博客帖子发布。 Facebook给你一个电子邮件地址,您可以通过手机发送照片,并将其发布在您的个人资料中。雅虎组织还会向您发送一封电子邮件地址,将发送的电子邮件转发给订阅者。

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.

推荐答案

这主要是关于正确配置您的MTA。实际上,您可以使用大多数MTA中提供的配置选项来完成此操作 - 以下是 sendmail

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.

如果您想通过自己的脚本进行漏洞,请确保所有有效的地址正确路由,然后设置域的默认收件人(因为您不提到你正在使用什么MTA,或者甚至运行哪个操作系统,我不能猜到你怎么做)转发到一个处理程序脚本 - 所有的处理程序脚本需要做的是创建一个新的电子邮件(不要尝试转发原件)与内容(将原始标题作为附件添加到新消息中是非常好的)。

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

请注意,您需要在From/Reply-To头文件中添加新的本地地址(@ domain.com),以避免邮件被分类为垃圾邮件。

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.

这篇关于通过PHP或任何其他脚本创建电子邮件地址的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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