Jump to content

Insert Data to database with the email body


alain

Recommended Posts

I'm trying to insert data to my MSsql server database with an email. This is the scenario: Users send an email to a specific email, when the email is received the code or server insert the text of the email in a table in my database. Somebody told me that blogger do this with their blogs (you can post to your blog sending an email), but nobodycan tell me how they do it. Thanks for your help.

Link to comment
Share on other sites

You need to either set up an email client to check the account and execute a program when you get an email that can parse the email and add it to the database, or have a script run periodically to log in to the email account and check it. In either case you would want to check for some type of verification text in the email to make sure you don't process something that's not a proper submission. Languages like ASP and PHP should have a way to log in to a POP3 or IMAP account, I know PHP does.http://www.php.net/manual/en/ref.imap.php

Link to comment
Share on other sites

You need to either set up an email client to check the account and execute a program when you get an email that can parse the email and add it to the database, or have a script run periodically to log in to the email account and check it. In either case you would want to check for some type of verification text in the email to make sure you don't process something that's not a proper submission. Languages like ASP and PHP should have a way to log in to a POP3 or IMAP account, I know PHP does.http://www.php.net/manual/en/ref.imap.php
Thank you for your response.You gave me an idea to make this works. Maybe a code that read my email account. I need this in ASP so i need to find how can i read a pop3 account from asp without a component, because i can do it with asppop3 but it's hardly to find a server with this component installed. I need to insert only two fields, TITLE and COMMENT. The email should have this structure:[TITLE] this is the title [/TITLE][COMMENT] this is the comment.... [/COMMENT]and i will only insert the text inside of these tags.But, one more time, i need to know how can i access to a pop3 email account from asp without a component...
Link to comment
Share on other sites

I'm not aware of a componentless way to get ASP to access a POP3 account. I was going to suggest that you can just open a socket yourself on port 110 and read the RFC for POP3 to understand the communication protocol, but I can't even find a way to use a socket in ASP without a component. I would think there would have to be a way to just open a TCP socket, but apparently not, at least not one I found. With large ASP projects you almost need to admin the server yourself so that you can install what you need to install for ASP to do what you want to do, without any components it's pretty limited. So, if you have to use ASP then you'll need to get a private server or an account where you can install components, or else use something else like PHP.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...