Looking for "email-to-website" code

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
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Looking for "email-to-website" code

Post by redhair »

Anyone can help me where to find a system like this:

* Users must be able to send bug rapports with attachments via email.
The email address should look like "*product*-*bugfix*@server.com".

* The email must be passed on to members on the mailing list.

* The email must appear -on the or like a- website with message and attachment under the *product* category as defined in the email address.

Something like this exists?
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Are you able to create the addresses manually or does it need to be dynamic? You'll need to modify your MX configuration in order to have them dynamic (probably).

After that, it's not straightforward. You can go one of two routes.

1. Write system filters for the SMTP-end of things such everything is done when the email hits the MX (less complicated but you need outright access to the SMTP server itself). You can "pipe" messages over to a PHP script with MySQL access.

2. Use the IMAP functions from PHP in order to open the mailbox remotely via cron or such like and parse the emails from there.

Making it fully working is way too much to post in here though ;)
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

The idea is so simple, as usual, but the realisation complex.

I just realise that the subject line could also contain the bugfix part, so email address could just be "product"-bugfixes@mailserver.com subject: *bugfix*. So email addresses don't have to be dynamic but can be manually created.

Thanks for some pointers.
I'll do some more digging/ brain storming with them.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

In the same vein as IMAP, you could abuse the catch-all address of the domain to support this sort of functionality.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Why not just have one single email address for tracking and provide different info via the subject?
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

d11wtq wrote:Why not just have one single email address for tracking and provide different info via the subject?
Then users have to specify the product in a predefined way in the subject for the script to filter out which product we are dealing with. I think my second idea would work better, where the product is defined by it's address.
nickvd
DevNet Resident
Posts: 1027
Joined: Thu Mar 10, 2005 5:27 pm
Location: Southern Ontario
Contact:

Post by nickvd »

redhair wrote:
d11wtq wrote:Why not just have one single email address for tracking and provide different info via the subject?
Then users have to specify the product in a predefined way in the subject for the script to filter out which product we are dealing with. I think my second idea would work better, where the product is defined by it's address.
Either way they will have to enter the product they're submitting the bug report for... using a single email address with varying subject (which can be pre-filled using mailto:email@address.com?subject=Productname-bugreport) would be much easier to deal with on the php side..
User avatar
redhair
Forum Contributor
Posts: 300
Joined: Fri May 30, 2003 4:36 pm
Location: 53.23N-6.57E
Contact:

Post by redhair »

i found the solution with a little help from this class.

All we have to do now is setup an email for each individual product like: product-bugfix@myserver.com

The script I'm using will read the emails+subject sent to that address and parse them on the website, just like I wanted it to.

The rest, like sending it on to the rest of the users is peanuts.

Thanks for thinking along with me!
Post Reply