web blazonry web development scripts and tutorials
 
Web blazonry.com
   Home       PHP       Name Generators       Perl       CSS       Javascript       Java       devTips       Resources   

Perl Home

Perl Scripts
  Count Links
  Mail to MySQL
  ProcLog Files
  Search and Replace
  Site Monitor
  UnTabify

Perl Articles
  csv2htm Converter
  OLE Automation
  Regular Expressions
  SubDir Recursion

Perl Resources
  Regular Expressions Quick Reference
  Regular Expressions Examples
  Recommended Sites
  Bestselling Perl Books
  Free Perl Books (new)
  Free Python Books(new)





Perl : mail2mysql

December 2000

mail2mysql.pl is a script which reads a mailbox file, parses the messages and inserts them into a MySQL database.

Background
This script was written to send notices via email and have them displayed on the web. The script monitors an email box for messages, when a message arrives it gets put into a database. The database entries are displayed on a webpage using PHP. Because the final destination was the web, I wanted the email messages to be displayed as HTML.

Requirements

  • mhonarc email to HTML converter.
    mhonarc is used to parse multipart messages and to convert the plain text email to HTML messages.

  • MailTools module
    This module is used to parses the mailbox into individual messages. It needs to be downloaded from CPAN.

  • DBI - MySQL
    Appropiate DBI and MySQL drivers should be installed to insert the messages into the database.

See script comments for more customization and configuration.

Download Script: mail2mysql_pl.txt


Related Links:

mhonarc.org - An e-mail to HTML converter

CPAN Mail Category

 

Newest Pages
Free Linux Admin Books
Free Linux Books for Programmers
Free Books for Linux on the Desktop
Free PHP Books
Free JavaScript Books
Free Java Books - Advanced
Free Java Books - Basic
Free Perl Books
Free Python Books
Quote of the Day (PHP)
Debugging Part 2
How to Test Google Ads
Source Code for Test Google Ads (PHP)
Most Popular Pages
U.S. Name Generator
Wu Name Generator
Baby Name Generator
Upload and Resize an Image (PHP)
Popup Windows (JavaScript)
How To Install Apache + PHP + MySQL
Simple Web Calendar (PHP)

Least Popular Pages
Image Load-Order (Javascript)
dHTML: Scrolling Layers
iNews Aplet (Java)
ProcLog Search Your Logs (Perl)
 
 

  © 1997-2007. astonishinc.com   All Rights Reserved.