Ask a Question related to PERL Beginners, Design and Development.
-
perl@swanmail.com #1
cgi mail script anyone?
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]jdoe@some.com[/email]
From: [email]support@some.com[/email]
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
perl@swanmail.com Guest
-
Form Mail Script
Hello, could anyone tell me exactly how to edit the script to make it work and where to place the files on my website directories? I've been... -
Help with Mail Script CDO/ASP and Session Var
I have a mailscript CDO using ASP technology, and I need to include the aid valude or id value of the recordset in the script so they can click the... -
Mail Script Help.
"." </@.> writes: Yo Walt, try putting your name in the From field of your post, makes you look less lurky. Try, using the Open URL script... -
SEND MAIL script with check box
okay - i've figured out how to make a check box into a button that performs a SEND MAIL script. but - i can't figure out how to add a step to the... -
the script hangs up when i try to send mail with attachments using MAIL::Sender...???
As said in the topic... when i try to send an e-mail message using Mail::Sender the script hangs up before execution of $sender ->... -
Zsdc #2
Re: cgi mail script anyone?
[email]perl@swanmail.com[/email] wrote:
See [url]http://search.cpan.org/modlist/Mail_and_Usenet_News/Mail[/url]> 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).
--
ZSDC
Zsdc Guest
-
Tn #3
RE: cgi mail script anyone?
Perhaps you can use sqwebmail. It supports vpopmail authentication but
requires Maildir format mailboxes. Maildirs were introduced with qmail
and have reliability advantages over the usual Mailbox files. If you
need to convert Mailboxes to Maildirs, see the qmail docs. Sqwebmail is
available from inter7, the developers of vpopmail, see
[url]http://www.inter7.com/sqwebmail.html[/url].
If you just need to send mail, I've found Mail::Send and Mail::Mailer
work well for that from the command line. You would just need to build
a CGI forms interface to them for sending mail through a web interface.
Basically that would require capturing the mail header and body in perl
variables and passing them to a function or separate program that send
the message using the Mail::Send|Mail::Mailer routines. Each of those
packages includes several example programs.
-tristram
Tn Guest
-
perl@swanmail.com #4
RE: cgi mail script anyone?
I'm just trying to send mail from a programming script NOT a real client.
For example, a monitor script calculating the disk storage and sending a
report/alert via the perl program.
I really don't want to add more library or module than necessary. So if
you guys can detect something wrong with this code let me know?
#!/usr/bin/perl
use strict;
use warnings;
my $mailprog = '/bin/mail';
my $tomail = 'bob@some.com';
my $inquirer = 'support@some.com';
#EMAIL
open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";
print MAIL "To: $tomail\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);
-rkl> Perhaps you can use sqwebmail. It supports vpopmail authentication but
> requires Maildir format mailboxes. Maildirs were introduced with qmail
> and have reliability advantages over the usual Mailbox files. If you
> need to convert Mailboxes to Maildirs, see the qmail docs. Sqwebmail is
> available from inter7, the developers of vpopmail, see
> [url]http://www.inter7.com/sqwebmail.html[/url].
>
> If you just need to send mail, I've found Mail::Send and Mail::Mailer
> work well for that from the command line. You would just need to build
> a CGI forms interface to them for sending mail through a web interface.
> Basically that would require capturing the mail header and body in perl
> variables and passing them to a function or separate program that send
> the message using the Mail::Send|Mail::Mailer routines. Each of those
> packages includes several example programs.
>
> -tristram
>
>perl@swanmail.com Guest
-
perl@swanmail.com #5
Re: cgi mail script anyone?
I can't seem to get this script working. I just want a simple code so I
can send mail that can change the reply address. I could get the command
line /bin/mail working with a system("/bin/mail..."); but I could not
change the From so it doesn't say [email]root@some.com[/email]. I don't want to open
socket and send smtp or load some modules.
Any ideas?
my $mailprog = '/bin/mail';
my $tomail = 'bob@some.com';
my $frmail= 'support@some.com';
#EMAIL
open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";
print MAIL "To: $tomail\n";
print MAIL "Reply-To: $frmail\n";
print MAIL "From: $frmail\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);
thanks,
rkl
> 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]jdoe@some.com[/email]
>>From: [email]support@some.com[/email]
>>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]beginners-cgi-unsubscribe@perl.org[/email]
>>For additional commands, e-mail: [email]beginners-cgi-help@perl.org[/email]
>
>perl@swanmail.com Guest
-
Tn #6
RE: cgi mail script anyone?
/bin/mail and other Unix/Linux user mail agents preserve the From
address based on your login UID. There is no way to make them lie about
the From address without modifying their sources. It's possible to
setup domain masquerading with sendmail or qmail. That way you could
fake the @some.com part. But sendmail, qmail and vpopmail rely on the
underlying login UID to make the username part of the mail address. If
you're root, then you can create a login account with the name of your
liking and su to that account before sending mail.
However, I encourage you to dig into the installation and use of
contributed, opensource perl modules, since you have before you a
simplest opportunity for doing it that will payoff quick.
-tristram
-----Original Message-----
From: [email]perl@swanmail.com[/email] [mailto:perl@swanmail.com]
Sent: Friday, October 03, 2003 11:25 PM
To: Teresa Raymond; [email]beginners@perl.org[/email]
Subject: Re: cgi mail script anyone?
I can't seem to get this script working. I just want a simple code so I
can send mail that can change the reply address. I could get the command
line /bin/mail working with a system("/bin/mail..."); but I could not
change the From so it doesn't say [email]root@some.com[/email]. I don't want to open
socket and send smtp or load some modules.
Any ideas?
my $mailprog = '/bin/mail';
my $tomail = 'bob@some.com';
my $frmail= 'support@some.com';
#EMAIL
open (MAIL, "|$mailprog") || die "Can't open mailprog.\n"; print MAIL
"To: $tomail\n"; print MAIL "Reply-To: $frmail\n"; print MAIL "From:
$frmail\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);
thanks,
rkl
> 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]jdoe@some.com[/email]
>>From: [email]support@some.com[/email]
>>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]beginners-cgi-unsubscribe@perl.org[/email]
>>For additional commands, e-mail: [email]beginners-cgi-help@perl.org[/email]
>
>
--
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Tn Guest
-
perl@swanmail.com #7
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 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='bob@some.com';
my $inquirer='support@some.com';
#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]jdoe@some.com[/email]
>>From: [email]support@some.com[/email]
>>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]beginners-cgi-unsubscribe@perl.org[/email]
>>For additional commands, e-mail: [email]beginners-cgi-help@perl.org[/email]
>
>perl@swanmail.com Guest
-
Dan Muey #8
RE: cgi mail script anyone?
> Thanks, you did good with this code for me. I did not want to
Why not? One simple use statement and you're done. Platform independent,> load more library as most suggested. This works just fine
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 => 'bob@some.com',
fr => 'support@some.com',
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:
[url]http://search.cpan.org/~dmuey/[/url]
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='bob@some.com';
> my $inquirer='support@some.com';
>
> #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--
>> print MAIL> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";> a reply or> > "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>> >> >>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]jdoe@some.com[/email]
> >>From: [email]support@some.com[/email]
> >>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]beginners-cgi-unsubscribe@perl.org[/email]
> >>For additional commands, e-mail: [email]beginners-cgi-help@perl.org[/email]
> >
> >
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
>
>Dan Muey Guest
-
Roberts Mr Richard L #9
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:dmuey@infiniplex.com]
Sent: Tuesday, October 07, 2003 12:35 PM
To: [email]perl@swanmail.com[/email]; Teresa Raymond; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
Subject: RE: cgi mail script anyone?
Why not? One simple use statement and you're done. Platform independent,> Thanks, you did good with this code for me. I did not want to
> load more library as most suggested. This works just fine
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 => 'bob@some.com',
fr => 'support@some.com',
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:
[url]http://search.cpan.org/~dmuey/[/url]
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='bob@some.com';
> my $inquirer='support@some.com';
>
> #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--
>> print MAIL> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";> a reply or> > "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>> >> >>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]jdoe@some.com[/email]
> >>From: [email]support@some.com[/email]
> >>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]beginners-cgi-unsubscribe@perl.org[/email]
> >>For additional commands, e-mail: [email]beginners-cgi-help@perl.org[/email]
> >
> >
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
>
>
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Roberts Mr Richard L Guest
-
Tn #10
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:ROBERTSRL@usmc-mccs.org]
Sent: Tuesday, October 07, 2003 12:48 PM
To: 'Dan Muey'; [email]perl@swanmail.com[/email]; Teresa Raymond; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
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:dmuey@infiniplex.com]
Sent: Tuesday, October 07, 2003 12:35 PM
To: [email]perl@swanmail.com[/email]; Teresa Raymond; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
Subject: RE: cgi mail script anyone?
Why not? One simple use statement and you're done. Platform independent,> Thanks, you did good with this code for me. I did not want to
> load more library as most suggested. This works just fine
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 => 'bob@some.com',
fr => 'support@some.com',
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: [url]http://search.cpan.org/~dmuey/[/url]
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='bob@some.com';
> my $inquirer='support@some.com';
>
> #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--
>> print MAIL> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";> a reply or> > "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>> >> >>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]jdoe@some.com[/email]
> >>From: [email]support@some.com[/email]
> >>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]beginners-cgi-unsubscribe@perl.org[/email]
> >>For additional commands, e-mail: [email]beginners-cgi-help@perl.org[/email]
> >
> >
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
>
>
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
--
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Tn Guest
-
Roberts Mr Richard L #11
RE: cgi mail script anyone?
the code:
$ssh->cmd("mkdir $direct");
functions as directory '$direct' is created,
yet my next line of code:
$ssh->cmd("cd $direct"); chokes as I run next line to confirm:
$ssh->cmd("pwd"); shows no directory change, still in parent directory
thus when I run:
$ssh->cmd("cp $file1 $file2");
gets no responce i.e. no file is copied.
Does that makes sence?
sierrasurf
-----Original Message-----
From: TN [mailto:tn@eldan.cc]
Sent: Tuesday, October 07, 2003 1:10 PM
To: 'Roberts Mr Richard L'
Cc: 'Dan Muey'; [email]perl@swanmail.com[/email]; 'Teresa Raymond'; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
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:ROBERTSRL@usmc-mccs.org]
Sent: Tuesday, October 07, 2003 12:48 PM
To: 'Dan Muey'; [email]perl@swanmail.com[/email]; Teresa Raymond; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
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:dmuey@infiniplex.com]
Sent: Tuesday, October 07, 2003 12:35 PM
To: [email]perl@swanmail.com[/email]; Teresa Raymond; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
Subject: RE: cgi mail script anyone?
Why not? One simple use statement and you're done. Platform independent,> Thanks, you did good with this code for me. I did not want to
> load more library as most suggested. This works just fine
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 => 'bob@some.com',
fr => 'support@some.com',
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: [url]http://search.cpan.org/~dmuey/[/url]
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='bob@some.com';
> my $inquirer='support@some.com';
>
> #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--
>> print MAIL> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";> a reply or> > "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>> >> >>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]jdoe@some.com[/email]
> >>From: [email]support@some.com[/email]
> >>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]beginners-cgi-unsubscribe@perl.org[/email]
> >>For additional commands, e-mail: [email]beginners-cgi-help@perl.org[/email]
> >
> >
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
>
>
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
--
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Roberts Mr Richard L Guest
-
Roberts Mr Richard L #12
RE: cgi mail script anyone?
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:tn@eldan.cc]
Sent: Tuesday, October 07, 2003 1:10 PM
To: 'Roberts Mr Richard L'
Cc: 'Dan Muey'; [email]perl@swanmail.com[/email]; 'Teresa Raymond'; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
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:ROBERTSRL@usmc-mccs.org]
Sent: Tuesday, October 07, 2003 12:48 PM
To: 'Dan Muey'; [email]perl@swanmail.com[/email]; Teresa Raymond; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
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:dmuey@infiniplex.com]
Sent: Tuesday, October 07, 2003 12:35 PM
To: [email]perl@swanmail.com[/email]; Teresa Raymond; [email]beginners@perl.org[/email];
[email]beginners-cgi@perl.org[/email]
Subject: RE: cgi mail script anyone?
Why not? One simple use statement and you're done. Platform independent,> Thanks, you did good with this code for me. I did not want to
> load more library as most suggested. This works just fine
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 => 'bob@some.com',
fr => 'support@some.com',
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: [url]http://search.cpan.org/~dmuey/[/url]
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='bob@some.com';
> my $inquirer='support@some.com';
>
> #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--
>> print MAIL> > $mailprog = '/your/sendmail/path'
> >
> > #EMAIL
> > open (MAIL, "|$mailprog") || die "Can't open mailprog.\n";> a reply or> > "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>> >> >>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]jdoe@some.com[/email]
> >>From: [email]support@some.com[/email]
> >>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]beginners-cgi-unsubscribe@perl.org[/email]
> >>For additional commands, e-mail: [email]beginners-cgi-help@perl.org[/email]
> >
> >
>
> --
> To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
> For additional commands, e-mail: [email]beginners-help@perl.org[/email]
>
>
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
--
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
--
To unsubscribe, e-mail: [email]beginners-unsubscribe@perl.org[/email]
For additional commands, e-mail: [email]beginners-help@perl.org[/email]
Roberts Mr Richard L Guest



Reply With Quote

