Methods to read mailbox 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
User avatar
Heavy
Forum Contributor
Posts: 478
Joined: Sun Sep 22, 2002 7:36 am
Location: Viksjöfors, Hälsingland, Sweden
Contact:

Methods to read mailbox using PHP.

Post by Heavy »

I have a customer that wants to be able to send email to the news site I am building. An email will contain information that is supposed to be published on the site as "news".

To the customer I say: Yes! of course! Anything is possible!
But I am not 100% sure which way to go.

The server is a linux box running teapop for a pop server, but that might change to for example postfix or something (postfix is pop? isn't it? nevermind... That is off topic.).

The emails are recieved to a user account on the server that the website should check for mail.

This means I will need to let PHP open the mailbox, scan it, take any message in it and process it according to a given news mail syntax that I create. The latter is piece of cake. What I am wondering is how to read those mails from the spool/pop-server/whatever.

Has anyone done this before?

If noone directs me to do otherwise, my first attempt will be to examine the possibilities of locking, reading and updating the mail spool with the filesystem functions provided with PHP.
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

User avatar
Heavy
Forum Contributor
Posts: 478
Joined: Sun Sep 22, 2002 7:36 am
Location: Viksjöfors, Hälsingland, Sweden
Contact:

Post by Heavy »

Zanx.
I will check it out.
As it turned out, building a mail client wasn't anywhere near as hard as I thought it would be...and with the help of powerful open-source tools like PHP, the process was simplified considerably.
Yeah. That is always my guess. PHP should be available for use with any kind of idea. I love it!
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

I still havn't been able to make it make my coffee, but one day... ;)
User avatar
Heavy
Forum Contributor
Posts: 478
Joined: Sun Sep 22, 2002 7:36 am
Location: Viksjöfors, Hälsingland, Sweden
Contact:

Post by Heavy »

Aaargh!
You got me you swedish bas***d! :lol:
Post Reply