lunchb0x has asked for the wisdom of the Perl Monks concerning the following question:

Greetings All!

I am a noob but would like to use Perl to do the following.

1. Check my GMail (POP3) account
2. Download attachments from messages with a specific label
3. After successful download delete message, otherwise leave it in inbox
4. Attachments are .csv files
5. Import .csv files to mysql
6. Email me of success or failure

I have found several scripts that address pieces of the problem but nothing I found pulls it all in.

Thanks!

20070701 Janitored by Corion: Content restored

  • Comment on Download POP3 attachmetns, import to mysql

Replies are listed 'Best First'.
Re: Download POP3 attachmetns, import to mysql
by Corion (Patriarch) on Jun 30, 2007 at 14:56 UTC

    We usually do not write scripts on request here. We prefer to educate people about how they can improve their own code.

    To the more concrete problem at hand, what problems did you encounter while solving your problem using Net::POP3 ? I use it in my Mailfetch program to download mails from a POP3 account.

    For importing your data, you most likely, you will want to use either the bulk loader that comes with MySQL - maybe it's called mysql, or you might want to use the DBI module, together with the MySQL database driver, DBD::mysql.

    For sending mail, I often use MIME::Lite - the SYNOPSIS section of the module tells you about all there is to know about using it.

    When you have written a small prototype, you can post that and we will try to help you improving it, provided that you have specific questions.

Re: Download POP3 attachmetns, import to mysql
by marto (Cardinal) on Jun 30, 2007 at 15:00 UTC
    Hi lunchb0x,

    Perhaps you are going to have to learn some Perl rather than hope that someone has already written a single script that does exactly what you are looking for.

    If you are new to Perl why not check out the Tutorials section of this site. You say you have found individual scripts that address part of your requirements, what are you missing? What steps are you having problems with? You have already broken down the tasks your program needs to complete, now you can start to put together a script (based on the resources you have found already,) to achieve these tasks.

    You should read the PerlMonks FAQ and How do I post a question effectively?, also have a look at CPAN for modules you will need to complete this task.

    Martin