Note: forwarded message attached.


Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
--- Begin Message ---
Thanks Gunnar for responding
What I am looking for is how "code wise" find the last modified file in a directory within a script. here us my script
 
 
use MIME::Lite;
use Net::SMTP;
### Adjust sender, recipient and your SMTP mailhost
my $from_address = '[EMAIL PROTECTED]';
my $to_address = '[EMAIL PROTECTED]';
my $mail_host = 'smtp.domainname.net';
### Adjust subject and body message
my $subject = 'A message with 2 parts ...';
my $message_body = "Here's the attachment file(s) you wanted";
### Adjust the filenames
my $my_file_txt = 'P:\\Program Files\\Prog_Dir\\myfile062804.txt';
### this is where I get stuck. the file in this dir changes everyday and I
 ###need to grab the last modified one and email it.

### Create the multipart container
$msg = MIME::Lite->new (
  From => $from_address,
  To => $to_address,
  Subject => $subject,
  Type =>'multipart/mixed'
) or die "Error creating multipart container: $!\n";
### Add the text message part
$msg->attach (
  Type => 'TEXT',
  Data ="" $message_body
) or die "Error adding the text message part: $!\n";
### Add the TXT file
$msg->attach (
   Type => 'text/html',
   Path => $my_file_txt,
  
   Disposition => 'attachment'
) or die "Error adding $file_txt: $!\n";
 
### Send the Message
MIME::Lite->send('smtp', $mail_host, Timeout=>60);
$msg->send;
 
Thanks.
FH
 


Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote:
F H wrote:
> I have a directory where log files are saved in on a daily basis by
> a VB program. and what I need is a way to get the last file stored
> into that directory. The last modified file in that directory
> should do it.

perldoc -f stat

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
--- End Message ---
-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>

Reply via email to