Search code examples
phpemailsmtpmta

MTA for receiving mails, in PHP


is there a library/class/code-snippet/etc. that allows me to directly receive mail in php?

So that I don't have to run an additional sever in an other process and then have to somehow send the mails to the already-running php-process.

I've been looking around for a while, but results for "php" and "mail" or "mta"/"smtp" on google focus mostly on sending mail, or retrieving it using pop3 or imap...

[EDIT]

What I'm trying to do is forward the messages to an IRC-channel, so obviously when the IRC-bot (in PHP) isn't running, loosing the mails is not a big deal. However having a low latency between receiving the mail and posting it on IRC is.


Solution

  • Writing your own SMTP server to act as a MTA is a big undertaking. You could take a look at http://cloudmailin.com. CloudMailin allows you to receive the incoming email as an HTTP Post and acts as the MTA sending the email direct to your PHP app. The PHP app can then process the email and send it to the IRC channel.