Receiving mail using php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AGISB
Forum Contributor
Posts: 422
Joined: Fri Jul 09, 2004 1:23 am

Receiving mail using php

Post by AGISB »

I am looking for a script that is capabale of receiving mail from sendmail and store them into my database system. Is this possible? The script would have to listen and therefore run continuosly.

The reason for this would be that I want to combine my internal database driven mail system with outside emails so that the admin can see all in one admin tool.
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

You just need to set up sendmail to forward the relevenat emails to a php script which can then do whatever you want with the contents of the email.
http://www.evolt.org/article/Incoming_M ... /18/27914/ has an example.
painperdu
Forum Newbie
Posts: 12
Joined: Fri Mar 04, 2005 4:44 am

Post by painperdu »

A nice and hard to find tutorial on this subject :
http://www.linuxscope.net/articles/mail ... tsPHP.html

Exactly what you're looking for (except it doesn't use sendmail):
http://sourceforge.net/project/showfile ... _id=104718
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

moved to php-code. Plenty of posts about this on the board, the search-function will work miracles.
Post Reply