Perl Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesPerl Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old February 9th, 2001, 08:37 PM
cdherold cdherold is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: San Deigo
Posts: 0 cdherold User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old February 9th, 2001, 09:14 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
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!

Reply With Quote
  #3  
Old February 10th, 2001, 01:28 AM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Thumbs up

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.

Reply With Quote
  #4  
Old February 10th, 2001, 12:22 PM
cdherold cdherold is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: San Deigo
Posts: 0 cdherold User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
via SMTP or POPMAIL. Does it make a difference?

cdherold

Reply With Quote
  #5  
Old February 10th, 2001, 04:20 PM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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...

Reply With Quote
  #6  
Old February 10th, 2001, 08:26 PM
cdherold cdherold is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Location: San Deigo
Posts: 0 cdherold User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #7  
Old February 10th, 2001, 09:02 PM
mickalo's Avatar
mickalo mickalo is offline
Ole` Timer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2000
Location: N.W. Iowa
Posts: 469 mickalo User rank is Private First Class (20 - 50 Reputation Level)mickalo User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 5 h 19 sec
Reputation Power: 8
Send a message via AIM to mickalo Send a message via MSN to mickalo
Thumbs up

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

Reply With Quote
  #8  
Old February 11th, 2001, 03:16 AM
dwarf dwarf is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 300 dwarf User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
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...

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPerl Programming > Writing e-mail to database


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway