|
|
|
|
![]() ![]() |
Apr 2 2006, 06:20 AM
Post
#1
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 195 Joined: 18-November 05 Member No.: 14,521 |
hello guys, it's been a couple of days that i dont know where this script must be placed and in which format...i know it is from perl but what format should i use .pl or .cgi, yep i am a newbie
i also saw that there is a folder in my directory called cgi-bin, do i have tu put it there? QUOTE #!/usr/bin/perl
$recipient = "me@somemail.com"; # watch out for backslash $mail = "/usr/sbin/sendmail"; if($ENV{REQUEST_METHOD} eq 'POST') { read STDIN, $buffer, $ENV{CONTENT_LENGTH}; } else { $buffer = $ENV{QUERY_STRING}; } foreach $pair (split /&/, $buffer) { ($key, $value) = split /=/, $pair, 2; $value =~tr/+/ /; $value =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/eg; $FORM{$key} = $value; } ## special treatment for the comments field $FORM{comments} =~s/rn?/n/sg; ## here comes your form open MAIL, "|$mail $recipient"; print MAIL <<END; From: webserver@yoursite.com Subject: Contact Form Contact form filled by $FORM{name} $FORM{address} phone: $FORM{phone} fax: $FORM{fax} Comments: $FORM{comments} END if(!close MAIL) { print "(anti-spam-content-type:) text/htmlnn"; print "status=fail&error=Your+mail+could+not+be+sent"; } else { print "(anti-spam-content-type:) text/htmlnn"; print "status=ok"; } |
|
|
|
Apr 2 2006, 06:33 AM
Post
#2
|
|
|
Desperately seeking "any key" to continue... ![]() Group: Admin Posts: 3,478 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 |
Simply the answer is yes. It makes calling your script easier. However, if I'm not mistaken you're trying to send information over the email using form?
There's built-in script called cgimail and you can find a short tutorial here: How To Use Trap17 Cgi Formmail |
|
|
|
Apr 3 2006, 02:57 AM
Post
#3
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 195 Joined: 18-November 05 Member No.: 14,521 |
thanx boss, actually i was trying to send the Receipent from flash and i thought that using another script it could be possible...
But what you provided seems to be very helpful, btw i set a serach on the forum for that topic but i didnt find anything, i guess i will have to be very careful next time... and if i get it working i will show it to you EDITED: i got it working boss, but when it arrives at the mail it arrives like "myname@gamma.xisto.com" is there anyway i can solv this? replacing the account name with my name? This post has been edited by spy_charly: Apr 3 2006, 04:07 AM |
|
|
|
Apr 3 2006, 05:28 AM
Post
#4
|
|
|
Desperately seeking "any key" to continue... ![]() Group: Admin Posts: 3,478 Joined: 23-April 05 From: Trap17 storage box Member No.: 6,042 |
but when it arrives at the mail it arrives like "myname@gamma.xisto.com" is there anyway i can solv this? Well that's better than myname@someusinversity.department.edu before... If you are the only recipient to submitted email then I guess it really does not matter. However, since the mail service is through gamma.xisto.com and our hosting server's name is gamma, I personally do not have the control over that. I would suggest you contact OpaQue or send queries to Helpdesk (xisto.com/helpdesk) and see if there's a way of doing it. |
|
|
|
Apr 3 2006, 07:00 AM
Post
#5
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 205 Joined: 14-March 06 From: Vermont or Boston (USA) Member No.: 20,077 |
EDITED: i got it working boss, but when it arrives at the mail it arrives like "myname@gamma.xisto.com" is there anyway i can solv this? replacing the account name with my name? The is the default mailserver. If you it's displaying as that the "from" field in your script is probably misformatted. |
|
|
|
Apr 3 2006, 10:18 AM
Post
#6
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 570 Joined: 5-July 05 From: Ballarat Member No.: 9,042 |
Following on from gaea, I have my own question, is it possible to have a code line in there where you can tell the form, which mail server to use and what the email it should be replyed to and if you can put a name instead of an email address?
I know you can do it in PHP, but is cgimail that flexible? |
|
|
|
Apr 3 2006, 08:57 PM
Post
#7
|
|
|
Premium Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 195 Joined: 18-November 05 Member No.: 14,521 |
hi tudy!, i dont think you can do it, since it is already done by the cgi script, i tried downloading it but notepad and nor Dreamweaver could open it...
my suggestion anyway would be to download the script manually and set the preferences manually as well...the problem is that i dont know about cgi and that makes more the things more difficult... |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 7th October 2008 - 09:57 PM |