Mail to a PHP script
Moderator: General Moderators
-
bigmac2889
- Forum Newbie
- Posts: 1
- Joined: Wed Dec 10, 2008 9:58 am
Mail to a PHP script
Hello, I am curious if it would be possible to have a email forwarded to a php script, and then have that script take information from the e-mail and say put it into a database. Anyone know if and how one could do this.
Re: Mail to a PHP script
Not really. PHP is for the web, not email.
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Re: Mail to a PHP script
Actually, it is possible. You need to have access the the mail server though. Most mail server daemons provide a way to pipe the mail into a process. That process can easily be a PHP process.tasairis wrote:Not really. PHP is for the web, not email.
I've done this before with Exim4. I'll warn you though, it's not trivial.
EDIT | Also, I had grand plans of writing a daemon for Swift Mailer to accept mail directly into a PHP application, but it hasn't eventuated yet. You'd need a VPS to run it so you could bind to port 25.