如何使用PHP接收您的IP地址的电子邮件? [关闭]

In php it's easy to send email by mail() function, but how to receive email to my home server? Is it possible to host an email service at all?

PS. I'm using mac and running XAMPP stack.

PHP is meant for fast executed applications: You go to a website, PHP fires up a script, executes it, and terminates again. Most of the time, this takes less than a second. In order to receive emails, you'd have to listen on a port continuously. It's something PHP can do, but it doesn't mean you should.

What you want is probably just a local mail server, which has nothing to do with PHP. A mail server consists of two parts.

Alternatively, you can use an application that includes both, for instance Cutedge Systems's MailServe Snow.

For that you will need to setup a mail server, take a look at this forum post for pointers on how to do it for a mac.

PHP has nothing to do with it.