View Full Version : Writing an email responder

07-16-2007, 08:53 PM
Before I ask my question, here's some background - I've just recently migrated from WindowsXP to Ubuntu Linux, but unfortunately my programming experience hasn't ported across, lol. See, I've always coded in VB (NOT .net) and vbScript with nought but the merest smattering of javascript, although I'm a reasonably fast learner if I'm not presented something too complicated.

What I want to do is create an email autoresponder which logs in to a pop3 mail account (using SSL) and grabs all the messages (headers and bodies) and deletes them from the server, storing them in an array of strings, ignoring anything that isn't plain text.

From there, the program will check the array for certain keywords in certain positions, and will build a response email.

The program then needs to connect to an smtp server (usingSTARTTLS/SSL) and despatch the response email to a predefined address.

Now, the string and array handling and response I think I can just about figure out for myself - there's plenty resources out there that I can see.

What I can't find is information on how to connect and talk to POP3 and SMTP servers using SSL in Javascript - ie for retreiving and sending messages . Is it even possible? In windows I'd just use the MAPI interface in VB, but I don't want to do that. I'm happy in my new environment - I just need to learn how it all works.

In case you're wondering what it's for, I'm creating a forum-based roleplay game where play is managed by email from the app running on a little box I'm dedicating to the purpose, through the cablemodem and into the intertubes.

Can anyone shed some light on this, or will my lack of Javascript experience be too much of a hindrance? I'm willing to have a crack at anything you can suggest.

TIA of any help ;-)

Philip M
07-16-2007, 09:23 PM
You need a server-side language such as PHP or Perl for this. JavaScript is a client-side langauge which has no ability to read from or write to a file, or communicate with the server.