|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
hi -
I'm looking for a way to write e-mails, which are sent to my e-mail address, directly into a MySQL database, dynamically. I plan on calling the messages from the database to a webpage using PHP. It would be cool if the e-mail could be parsed into header, body, time received and give it an ID# as it was written into the database, but that's all extra. Any ideas. I have very limited use with PERL ... only written very simple CGI's for web site registration and the like. Thanks, cdherold |
|
#2
|
||||
|
||||
|
Are you referring to email your receive via SMTP mail server??
__________________
Thunder Rain Internet Publishing Custom Programming & Database development Providing Personal/Business Internet Solutions that work! |
|
#3
|
|||
|
|||
|
Just a little note: everything you need you can find on CPAN @ http://www.cpan.org/. To continue, Perl would be pretty cool for this, you would need a few tools. If you are going to fetch emal directly from your server (POP3) you can use Net::POP3 module, which provides an easy interface to do this. If you want to parse tou email file, then use some of the modules from the following URL:
http://theoryx5.uwinnipeg.ca/mod_pe...at;catinfo=1902 Another useful link: http://theoryx5.uwinnipeg.ca/mod_pe...=cat;catinfo=19 And, of course, you will need DBI and DBD::mysql modules which you can find also on CPAN. The rest is just reading the docs, and coding. HTH. |
|
#4
|
|||
|
|||
|
via SMTP or POPMAIL. Does it make a difference?
cdherold |
|
#5
|
|||
|
|||
|
It makes a big difference, since SMTP is for sending mail, which means, basically, that you would have to intercept the outgoing mail before it was sent. With POP3 you are fetching the incoming mail. Of course, the application will vary greatly based on what you want to do.
If you want all your outgoing mails to be stored in the database, then you really need to read the docs for your MTA (Mail transport Agent) and see what you can find in there. Basically, you can write a small app that would function as a basic mail clinet but also store the email message inside a database... Its very late, so maybe I am babbling... ![]() |
|
#6
|
|||
|
|||
|
i don't want any of the outgoing mail to be stored in the database ... just the ones I receive (which will be press releases from companies). And I would like it, if possible, that this all happened automatically . i.e. i would not have to call the program to get it to check my mailbox and then write to the database ... the program should be called automatically as the e-mail is received by my server.
dwarf, I checked the CPAN archives ... I could not find (may have missed) a MAIL script that meets my needs. I guess I'm just hoping that someone else has done this already and I can use the same script, but if that isn't the case (as I'm trying to divine through interactions like these) I'll just suck it up and learn a little more PERL and try to write the thing myself. thanks for your help ... any other comments are very welcome. cdherold |
|
#7
|
||||
|
||||
|
look into the Socket.pm module. You can use this to retreive your email from your POP3 account and extract the email addresses that way. Then you can process the results as needed. It's fairly simple to implement. The Socket module should be a standard module on your server.
Mickalo |
|
#8
|
|||
|
|||
|
Well, CPAN is not all abut scripts. Actually, it has no scripts on it. If you want some already done scripts, you could check the HotScripts archive @ http://www.hotscripts.com/. CPAN is a place where you can fine all sort of modules you can use for your needs.
If you want to store the messages that are coming to you, then I guess you could use the Net::POP3 module, which is a really nice wrapper and DBI module, which allows Perl to "talk" to databases. Mickalo, Socket.pm is good, but I don't know how much it could use in thins situation it being a little complicated if one doesn't know the C primitives that are used in it. The Net::Pop3 module would work just fine... |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Perl Programming > Writing e-mail to database |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|