Here's some Programming How-to's

Perl - how to send email from a windows PC when you're not a unix expert, dont have a sendmail server running (if you did you wouldn't be looking at this!). Pre-requisites are a gmail account - so go get one from www.gmail.com!
Here's how to get your PC to send email from a script.
0) create a gmail account if you haven't already got one
1) download Perl from http://www.activestate.com/activeperl/downloads
2) install in default place which is C:\perl - this takes quite a while
3) open a command window Start->Run... cmd then run the following commands
3.1) cd C:\perl\bin
3.2) ppm install Email-Send-SMTP-Gmail

4) create a new directory called c:\perl\test
4.1) create dummy files doc1.txt and doc2.txt in c:\perl\test (example files)

5) create file called sendemail.pl in c:\perl\test
5.1) edit sendemail.pl and add these lines
  use strict;
  use warnings;
  use Email::Send::SMTP::Gmail;
  use Win32;

  my $email=Email::Send::SMTP::Gmail->new( -smtp  => 'smtp.gmail.com',
                                           -layer=>'ssl',
                                           -port=>465,
                                           -login => 'your_gmail_login_id@gmail.com',
                                           -pass  => 'your_gmail_password');

  my $messagebody = "This is the message body";

  $email->send(-to          =>'your_friends_email_address@yahoo.com',
               -subject     =>'Test',
               -verbose     =>'1',
               -body        => $messagebody ,
               -attachments => 'C:\perl\test\doc1.txt,c:\perl\test\doc2.txt' );
  $email->bye;
5.2) obviously change the email addresses and password to your information

6) in the cmd window type
6.1) cd c:\perl\test
6.2) c:\perl\bin\perl sendemail.pl

Go ahead and try it.

Notes:
1) the -verbose flag can be removed but it's useful to start
2) the -attachments flag is sensitive to space characters - make sure that there are no spaces in the comma-separated list of file names
3) learn some Perl to make full use of the features.


READING EMAIL
Using IMAPClient
You'll have to use the command ppm install Mail-IMAPClient

This script also uses the printfile.exe utility prfile32.exe.
What the script does is check a gmail folder, see if there is message there and if there is then read it, print it out using the prfile32.exe program (check on-line for that) and then deletes the message when printed. After that it goes back to polling the gmail folder for more files to print. It also emails a copy (via a system call to another perl script, printlogreturn.pl), of the printlog file created by the prfile32.exe program.
use strict;
use warnings;
use IO::Socket::SSL;
use Mail::IMAPClient;

while (1)
{
  my $socket = IO::Socket::SSL->new(
    PeerAddr => 'imap.gmail.com',
    PeerPort => 993,
  )
  or die "socket error";


  my $imapc;
  my $file = "mails";

  $imapc = Mail::IMAPClient->new( Socket  => $socket,
                                  User    => 'myemailaccount@gmail.com',
                                  Password  => 'mypassword')
        or die "IMAP Failure: $@";

  if ($imapc->IsAuthenticated()) {
    print "Logged in OK.\n";
  }

  # move to the formum folder
  $imapc->select("messagestoprint"); 

  my $readandprint = 0;
  my $m = $imapc->message_count("messagestoprint");
  if (int($m) != 0)
  { 
    # print int($m);
    print "\nNew messages to print\n";
    $readandprint = 1;
  }
  else
  {
    print "No new message\n";
    $readandprint = 0;
  }

  if ($readandprint)
  {
    my @messages = $imapc->search('ALL');

    foreach my $message (@messages)
    {
      my $mbody = $imapc->body_string($message);
      print $mbody;
      open(PRINTFILE,">prfile.out");
      print PRINTFILE $mbody;
      close(PRINTFILE);
      $imapc->delete_message($message) or warn "no message deleted";
      system ('c:\printfile\prfile32.exe /q /e /l:c:\perl\mike\printlog prfile.out');

      # wait a bit
      sleep(120);
      # append the message to the logfile
      open(LOGFILE,">>printlog");
      print LOGFILE $mbody;
      close(LOGFILE);
      sleep(3);
      # email the printlog file
      system ('C:\perl\bin\perl c:\perl\mike\printlogreturn.pl');

      # wait a bit longer
      sleep(1800);
      # continue
    }
  }
  print "Shutting down\n";
  
  $imapc->logout();
  print "Sleeping\n";
  sleep(100);
}


mike