Email from DOS prompt using Perl

How can I email from DOS prompt using Perl script? I want to write a perl script that finds the IP address of the machine every 2 hours and send a user an email containing that IP address. An example script would be great. Operating system is NT Terminal Server and Outlook is properly configured on that.
masoudkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

malecCommented:
use MIME::Lite;

$msg = new MIME::Lite
                From    =>'me@myhost.com',
                To      =>'you@yours.com',
                Subject =>'A message from me..',
                Type    =>'TEXT',
               Path    => "ff";
MIME::Lite->send('smtp', "smtp.yourmailserver.ca", Timeout=>60);
$msg->send;

0
malecCommented:
Here's the whole thing. runs on NT.
Will need to install MIME::Lite (use ppm, install MIME-LITE)

Use it with scheduler.

#!/usr/bin/perl
use MIME::Lite;

`ipconfig.exe > ff`;
$ARGV[0] = 'ff';
for (<>) {
  $ip .= "$_\n" if(/IP Address/);
  }

$msg = new MIME::Lite
                From    =>'me@myhost.com',
                To      =>'d@perlnow.com',
                Subject =>'IP Address',
                Type    =>'TEXT',
                Data    => "$ip";

MIME::Lite->send('smtp', "smtp.sprint.ca", Timeout=>60);
$msg->send;



0
khacharnCommented:
hi masoudk..
what malec has suggested is great  and i was using the same MIME module UNTIL i cam across BLAT..
BLAT is a command line utility (.exe) program to send mails..
eg.
***************************************
blat file.txt -t masoudk@ee.com -b malec@ee.com -attach file.html
***************************************
What this does is it send a mail to masoudk@ee.com and a bcc to malec@ee.com with file.html as attachment and the body of the email will contain file.txt(contents of file.txt)
I think this is what you are looking for..
You can find more on BLAT at
http://www.interlog.com/~tcharron/blat.html..
IF you want you can give me your e-mail and i will send you the Blat.exe file
And Believe me..my life,my mailing programs have become real cool afeter i started using Blat
Regards
Nitin
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.