Help with my EMAIL?

email application help. Send email to made up email address which is redirected to real email

  • I'm wondering how i would go about making the following application: a user signs up, say with the username "johny-jones". Lets say for example that my domain is www.example.com if anyone emails [email protected] this email is redirected to johny-jones REAL email address

  • Answer:

    The simplest option is to tell your smtp server to forward all ingoing mails to an external program (your php script). For example, for qmail this will be like | php myphpscript.php in .qmail file. Your script will read email from stdin and resend it to the real address.

dotty at Stack Overflow Visit the source

Was this solution helpful to you?

Other answers

You're basically describing a http://en.wikipedia.org/wiki/Mail%5Ftransfer%5Fagent AKA mail server. So all you need to do is a server to run it on, the required MX DNS records, and an API that allows you to configure forward addresses. Look through the documentation of the servers http://en.wikipedia.org/wiki/Comparison%5Fof%5Fmail%5Fservers to see which ones offer the latter.

Michael Borgwardt

Just pipe all orphan email (specific to that domain) to ur PHP script and use something like this to extract the email content: $fd = fopen("php://stdin", "r"); $email = ""; while (!feof($fd)) { $email .= fread($fd, 1024); } fclose($fd); then extract the "to" field and if it belongs to a user .. forward the email to him.If you have cPanel .. this is even easier. goto mail > default address > set default address and instead of putting an email address there put something like this "|php -q /home/whatever/public_html/pipe.php" .. ofcourse without the quotes

Sabeen Malik

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.