Receiving emails and sending to a DB

BluJag

Perch
22 Feb 07

Does anyone know of a method whereby emails sent to an account can be somehow processed so they are added to a database?

Thanks.
 
Something weird going on with the forum. If I post a short reply like this it works but if I make it longer I get this when I hit the submit or preview buttons.

The requested URL /newreply.php was not found on this server.
 
I tried a new thread and got the same thing. Also tried a different forum, same thing. Something is screwy with the reply function for anything more than a few lines.
 
it gives a 404 if certain code is in the reply, as a protection against SQL injection, mail injections, etc. Was any code in your reply?
 
Thanks, Stephen. By binary chop process of elimination, I've found that it was objecting to the word w-get (without the dash).

BTW, what is the status of SocketPermission? I can't say that I've looked into it but the .NET classes that use it are probably no more dangerous than aspsock.

Here's my reply.

I think the easiest and probably only practical way on a shared host is to have some sort of regular repeating task that reads a mailbox and then does whatever it wants. I'm doing this on a Linux VPS with cron running w-get which hits a url which is a php script that reads a pop mailbox using the php imap extensions.

Php imap extensions are not installed on my Windows accounts at Jodo. I'm not sure about Linux. I see that the Windows accounts have a component called ASPPOP3 which could probably be used with some classic ASP. There are various libraries for ASP.NET for reading pop although you might run into problems because they would need SocketPermission and that doesn't come by default with medium trust.

Once you have a way of reading the mailbox, you'd need a way to hit the page at regular intervals, perhaps every 10 minutes so. I don't think you get scheduled jobs on Windows at Jodo so you'd need another way. If you or a friend had a Linux account you could hit it from there.

Cheers
Ross
 
Ross,

you can do imap on windows with php, just send a ticket and ask them to put a copy of the system php.ini in your domain root, then edit uncomment php_imap.dll :)
 
Back
Top