PDA

View Full Version : CGI Script Question


donr09
08-04-2007, 06:24 PM
I need a CGI Script that will pass data from a simple form to an e-mail address. I do not have the time to learn CGI scripting or perl or other new languages at this time.
I can change or manipulate the code as needed: server names, paths, etc.
I need to do this for another user on the network at work. They cannot work at the server level. They are creating the form. I have to take the data in the form and have it e-mailed to another user.
Since, I am new to this forum, I hope this is the correct spot to post this question.
If someone knows a better place to post this question, please let me know.

:confused:

lwebzem
08-11-2007, 02:13 PM
for sending email I use this function

sub send_email
{

use Mail::Sender;

my $fn1=shift;

$sender = new Mail::Sender
{smtp => 'mail.domain.com', from => 'myemail@mydomain.com'};
$sender->MailFile({to => 'email_name@domain.com',
subject => 'Log file',
msg => "Hello......",
file => $fn1});
}

to get data from form you can use something like that:

#!/usr/bin/perl -w
use CGI;
$data = new CGI;
$Submit=$data->param('Submit');
$message=$data->param('message');

donr09
08-12-2007, 11:07 AM
The new server has arrived. I will give it a try when i set it up this week.
DR