I have full permissions as earlier code creates new dir: $site, yet when I
try to 'cd' or even 'cwd' notta thus when I try to cp $ssh->cmd("cp $file
20020922"); it bombs.

-----Original Message-----
From: TN [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 1:10 PM
To: 'Roberts Mr Richard L'
Cc: 'Dan Muey'; [EMAIL PROTECTED]; 'Teresa Raymond'; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


Is the $site directory actually created?  What are it's permissions?
Maybe you can 

$ssh->cmd("cp $site/$filename");  

But I thought cp required at least two args.

-tristram

-----Original Message-----
From: Roberts Mr Richard L [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 07, 2003 12:48 PM
To: 'Dan Muey'; [EMAIL PROTECTED]; Teresa Raymond; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


I am using NET::SSH::Perl. Login is correct. mkdir is correct. Yet when
I try to pass a local file to remote host to copy file to newly created
directory, it fails: 

code:
use Net::SSH::Perl

my $ssh = Net::SSH::Perl->new($host);
$ssh->login($user, $pass);

print $ssh->cmd("mkdir $site);
print $ssh->cmd("cd $site); #does not change directory tested using
"cmd("pwd")" print $ssh->cmd("cp $filename");

etc...

Any help would help.

thanks in advance
Richard

-----Original Message-----
From: Dan Muey [mailto:[EMAIL PROTECTED]
Sent: Tuesday, October 07, 2003 12:35 PM
To: [EMAIL PROTECTED]; Teresa Raymond; [EMAIL PROTECTED];
[EMAIL PROTECTED]
Subject: RE: cgi mail script anyone?


> Thanks, you did good with this code for me. I did not want to
> load more library as most suggested. This works just fine 

Why not? One simple use statement and you're done. Platform independent,

No relying on an external program to be at the path you specify, use the
switches you specify, Or use the data in the format you specify.

I love Mail::Sender and I'm actually in the middle of a module that 
simplifies even using that (if you can imagine),

Once done it will look like this:


#/usr/bin/perl
use strict;
use warnings;
use WhateverTheHeckICallTheModule qw(emailx);

emailx({
        ip => '1.2.3.4',
        to => '[EMAIL PROTECTED]',
        fr => '[EMAIL PROTECTED]',
        sb => 'Inquiry Response Request',
        ms => $emailmessagehere
}) or die "No sendy mial $Error";

You can even make it html and add attachment inline or attached with one
simple hash entry.
        ht => $htmlversionhere,
        at => ...
Much easier to read and you can use it on any server. There's even a 
way to ammke the smtp ip address automaytic so you don'tr have to put 
a different one in each script, via the Mail::Sender default data.


For those interested kepp watching here: http://search.cpan.org/~dmuey/

HTH

DMuey

> with only one exception. I needed to use the -t option. Here
> is the revised version which worked for
> me:
> 
> #/usr/bin/perl
> use strict;
> use warnings;
> 
> my $mailprog = '/usr/sbin/sendmail -t'
> my $empemail='[EMAIL PROTECTED]';
> my $inquirer='[EMAIL PROTECTED]';
> 
> #EMAIL
> open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";
> print MAIL "To: $empemail\n"; print MAIL "Reply-To: 
> $inquirer\n"; print MAIL "From: $inquirer\n"; print MAIL 
> "Subject: Inquiry Response Request\n\n"; print MAIL 
> <<"PrintTag"; Please respond to the following inquiry: blah 
> blah blah, message here PrintTag close(MAIL);
> 
> --end code--
> 
> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";
> print MAIL
> > "To: $empemail\n"; print MAIL "Reply-To: $inquirer\n"; print MAIL 
> > "From: $inquirer\n"; print MAIL "Subject: Inquiry Response 
> > Request\n\n"; print MAIL <<"PrintTag";
> > Please respond to the following inquiry:
> > blah blah blah, message here
> > PrintTag
> > close(MAIL);
> >
> >
> > At 07:14 PM 10/3/2003, you wrote:
> >>I need to send a mail from the cgi. It must be able to have
> a reply or
> >>sender as someone different from the local web owner (apache). My
> >>configuration:
> >>  redhat 9/qmail/vpopmail
> >>
> >>  The example below will be typically what I want:
> >>
> >>To: [EMAIL PROTECTED]
> >>From: [EMAIL PROTECTED]
> >>Subject: "hello support test"
> >>this is a test
> >>with all your support
> >>
> >>I see alot of parts but can't get it working.
> >>can someone put a little script together that does this?
> >>
> >>thanks,
> >>-rkl
> >>
> >>--
> >>To unsubscribe, e-mail: [EMAIL PROTECTED]
> >>For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> 
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

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

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


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

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

Reply via email to