HP3000-L Archives

November 2002, Week 3

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
[log in to unmask][log in to unmask], 18 Nov 2002 14:32:33 -0800369_iso-8859-1 What can I do to allow me to use (used) DAT III tapes (from the 3K) on my tape backup
in my PC? No matter what I attempt it will not allow me to erase, format ?????

Gary Sielaff
City of Moses Lake, Wa.

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *50_18Nov200214:32:[log in to unmask]
Reply To:
Date:
Wed, 20 Nov 2002 10:55:26 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (81 lines)
I'm surprised that no one suggested perl... something like this, only better
written, and without the line wraps:

!/usr/bin/perl
# This script, when executed, will check for the existence of a file.
# Once the file is detected, this script will call one subroutines.
# It will the email the file.

use strict;
use Net::SMTP;
use Time::gmtime;

my $HTMLFile = "/ACCOUNT/GROUP/FILE";
my $contact1 = [log in to unmask];
my $customer = [log in to unmask];
my $Support  = [log in to unmask];
my $mailFrom   = [log in to unmask];
my $niceName   = "SMTP.HTML.Script";
my $prodsupp = [log in to unmask];
my $programmer = [log in to unmask];
my $server_name = "mail.domain.com";

# Script start - just test for the file.
#print "Looking for file \n";           #Remove prints once tested
unless (-e $HTMLFile) {
        print("No file\n");
        exit();
}
#print "File found \n";                 #Remove prints once tested
# Open file or die trying
unless (open(HTMLFile, "$HTMLFile")) {
        die ("Cannot open input file $HTMLFile.\n");
}
my @HTMLFile = <HTMLFile>;      #read file into array for later datasend
#print (@HTMLFile);             #Remove prints once tested
EmailFile();
close (HTMLFile);
rename ("$HTMLFile", "$HTMLFile.BAK"); # rename file, overwriting old .BAK

# This subroutine will email the file.
# The file is treated as body text. This is normal.
sub EmailFile {
        my ($smtp) = Net::SMTP->new($server_name,
                                Hello => 'HP3000.domain.com');
        $smtp->debug(0);
        if (defined($smtp)) {
                $smtp->mail($mailFrom);
                $smtp->to($customer, $programmer);      # restore these once
tested
#               $smtp->to($Support);                    # remark this once
tested
                $smtp->data();
# Remove "Test" when ready to move into production
                $smtp->datasend('Date: '.gmctime()."\n");
                $smtp->datasend("From: $niceName\n");
                $smtp->datasend("Reply-To: $prodsupp\n");
                $smtp->datasend("To: $customer\n");
                $smtp->datasend("Cc: $programmer, $Support\n");
                $smtp->datasend("Subject: Share and Enjoy!\n");
# These two lines are the MIME headers
                $smtp->datasend("Mime-Version: 1.0", "\n");
                $smtp->datasend("Content-Type: text/html; charset=US-ASCII;
name=\"$HTMLFile\";\n");
#               $smtp->datasend("Content-Disposition: attachment;
filename=\"$HTMLFile\"\n");
                $smtp->datasend("\n");
                $smtp->datasend(@HTMLFile, "\n");
                $smtp->dataend();
                $smtp->quit();
        }
        else {
#               do something appropriate to complain if needed
        }
}

Greg Stigers
http://www.cgiusa.com

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2