Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
help needed with $message part of CGI script
Old 07-24-2006, 08:06 PM help needed with $message part of CGI script
webgurl's Avatar
Skilled Talker

Posts: 70
Location: Australia
Trades: 0
I have a file upload script that sends you an email if someone uploads to your server. I need to track who the uploaded files belong to and so I have a created a field in my form named your_email. I want to be able to see their email address in the message part of the email.

Here is part of the script:

sub send_mail {
my ($from_email, $from_name, $to_email, $to_name, $subject, $message ) = @_;

if(open(MAIL, "|$CONFIG{mailprogram} -t")) {
print MAIL "From: $from_email ($from_name)\n";
print MAIL "To: $to_email ($to_name)\n";
print MAIL "Subject: $subject\n";
print MAIL "$message\n\nSubmitter's IP Address : $ENV{REMOTE_ADDR}";

close MAIL;
return(1);
} else {
return;
}
}


As I am not a coder (obviously), I tried what I thought would be the code to use without success.

print MAIL "$message\n\nSubmitter's Email Address : $your_email";

I really would appreciate any help with this one line of code. For there I can then add more fields if necessary.

Thank you

webgurl
webgurl is offline
Reply With Quote
View Public Profile Visit webgurl's homepage!
 
 
Register now for full access!
Old 07-24-2006, 08:21 PM Re: help needed with $message part of CGI script
webgurl's Avatar
Skilled Talker

Posts: 70
Location: Australia
Trades: 0
I made another error and can see this code duplicates itself.

This is how it is :

sub send_mail {
my ($from_email, $from_name, $to_email, $to_name, $subject, $message ) = @_;

if(open(MAIL, "|$CONFIG{mailprogram} -t")) {
print MAIL "From: $from_email ($from_name)\n";
print MAIL "To: $to_email ($to_name)\n";
print MAIL "Subject: $subject\n";
print MAIL "$message\n\nSubmitter's IP Address : $ENV{REMOTE_ADDR}\n";
#### print MAIL Submitter's Email Address : $your_email"; ######
close MAIL;
return(1);
} else {
return;
}
}


Thanks!
webgurl is offline
Reply With Quote
View Public Profile Visit webgurl's homepage!
 
Old 07-25-2006, 06:52 PM Re: help needed with $message part of CGI script
webgurl's Avatar
Skilled Talker

Posts: 70
Location: Australia
Trades: 0
Please view here: http://webco.net.au/test.txt
webgurl is offline
Reply With Quote
View Public Profile Visit webgurl's homepage!
 
Reply     « Reply to help needed with $message part of CGI script
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27369 seconds with 12 queries