Gossamer Forum
Home : General : Perl Programming :

Problems with Birdcast Recommend It install

Quote Reply
Problems with Birdcast Recommend It install
I hope this is appropriate in posting this here. I am trying to install the Birdcast Recommend It script on my site, then after I have it up and running I want to put Bobsie's mod on it for Links. I have been trying to get an answer from the Birdcast Bulletin Board, but it is not very active. I think my problem is that I want to use my sendmail program instead of using SMTP.I have set my paths and I use the $SEND_MAIL="/usr/sbin/sendmail" on my server, so I un-commented that line and commented the $SMTP_SERVER line. Every time I try to send the recommendation I get an internal error 500. I have set my permissions to 755 on the cgi file and 666 on the reflog.txt
At one point I changed;

$mailresult=&sendmail($fields{send_email}, $fields{send_email}, $fields{$recipemail}, $SMTP_SERVER, $subject, $msgtxt);

to

$mailresult=&sendmail($fields{send_email}, $fields{send_email}, $fields{$recipemail}, $SEND_MAIL, $subject, $msgtxt);

but that didn't work either. Could someone look at the code below and tell me what I am missing so I can get it up and running.
Code:
#!/usr/bin/perl
use Socket;
$|=1;
##################################################################
# birdcast.cgi Version 2.0
# updated May 2, 1999
# (C)1998, 1999 Bignosebird.com
# This software is FREEWARE! Do with it as you wish. It is yours
# to share and enjoy. Modify it, improve it, and have fun with it!
# It is distributed strictly as a learning aid and bignosebird.com
# disclaims all warranties- including but not limited to:
# fitness for a particular purpose, merchantability, loss of
# business, harm to your system, etc... ALWAYS BACK UP YOUR
# SYSTEM BEFORE INSTALLING ANY SCRIPT OR PROGRAM FROM ANY
# SOURCE!
##################################################################

# CONFIGURATION NOTES

#
# $SCRIPT_NAME is the full URL of this script, including the
# http part, ie, "http://domainname.com/cgi-bin/birdcast.cgi";
#
# $SITE_NAME is the "name" of your web site.
# $SITE_URL is the URL of your site (highest level)
# $END_LINE is the very last line printed in the e-mail.
#
# $MAXNUM is the number of possible people a person can refer
# your URL to at one time. If you call the script using the
# GET method, then this is also the number of entry blanks
# created for recipient names and addresses.
#
# $SMTP_SERVER is the name of your e-mail gateway server, or
# SMTP host. On most systems, "localhost" will work just fine.
# If not, change "localhost" to whatever your ISP's SMTP
# server name is, ie, smtp.isp.net or mail.isp.net

# $SEND_MAIL is the full path to your server's sendmail program
# If you do not wish to use Sockets for some reason and need
# to use sendmail, uncomment the $SEND_MAIL line and comment
# the $SMTP_SERVER line.

# okaydomains is a list of domains from which you want to allow
# the script to be called from. Leave it commented to leave the
# script unrestricted. If you choose to use it, be sure to list
# your site URL with and without the www.

# Use either $SMTP_SERVER
# $SMTP_SERVER="localhost";
#
# OR

$SEND_MAIL="/usr/sbin/sendmail";

# BUT NEVER BOTH!!!!!!

# @okaydomains=("http://yourdomain.com", "http://www.yourdomain.com");

$SCRIPT_NAME="http://www.homewithgod.com/cgi-homewithgod/birdcast.cgi";
$SITE_NAME="HomewithGod.com";
$SITE_URL="http://www.homewithgod.com/";
$ENDLINE="";
$MAXNUM=5;
$LOGFILE="reflog.txt";

if ($SENDMAIL ne "")
{&test_sendmail;}


&valid_page; #if script is called from offsite, bounce it!
&decode_vars;
if ( $ENV{'REQUEST_METHOD'} ne "POST")
{
&draw_request;
exit;
}
&do_log;
&process_mail;
print "Location: $JUMP_TO\n\n";

##################################################################
sub process_mail
{
for ($i=1;$i<$MAXNUM+1;$i++)
{
$recipname="recipname_$i";
$recipemail="recipemail_$i";
if ($fields{$recipemail} eq "")
{
next;
}
if (&valid_address == 0)
{
next;
}

#BNB SAYS! You can modify the Subject line below.

$subject = "Suggestion from $fields{'send_name'}";

#BNB SAYS! Modify the lines below between the lines marked
# with __STOP_OF_MAIL__ to customize your e-mail message
# DO NOT remove the lines that contain __STOP_OF_MAIL__!
# If you enter any hardcoded e-mail addresses, BE SURE TO
# put the backslash before the at sign, ie, me\@here.net

$msgtxt = <<__STOP_OF_MAIL__;
Hi $fields{$recipname},

$fields{'send_name'} stopped by $SITE_NAME
and suggested that you visit the following URL:

$JUMP_TO

__STOP_OF_MAIL__

if ($fields{'message'} ne "")
{
$msgtxt .= "Here is their message....\n";
$msgtxt .= "$fields{'message'}\n\n";
}
$msgtxt .= "$SITE_NAME\n";
$msgtxt .= "$ENDLINE\n";
$msgtxt .= "$SITE_URL\n\n";
$mailresult=&sendmail($fields{send_email}, $fields{send_email}, $fields{$recipemail}, $SMTP_SERVER, $subject, $msgtxt);

if ($mailresult ne "1")
{print "Content-type: text/html\n\n";
print "MAIL NOT SENT. SMTP ERROR: $mailresult\n";
exit
}

}
}

##################################################################
sub draw_request
{
print "Content-type: text/html\n\n";

#BNB SAYS! Here is the part that draws the page that asks the
#reader to enter e-mail addresses and names. Tailor it to meet
# your needs if necessary. DO NOT disturb the lines with
# __REQUEST__ on them.

print <<__REQUEST__;
<BODY BGCOLOR="#FFFFFF">
<CENTER>
<P>
<TABLE WIDTH=550 BGCOLOR="CCE6FF">
<TR>
<TD>
<FONT FACE="ARIAL" SIZE=4 COLOR="#009999">
<B>
<CENTER>
SUGGEST THIS PAGE TO A FRIEND...<P>
<A HREF="$ENV{'HTTP_REFERER'}">$ENV{'HTTP_REFERER'}</A>
</CENTER>
</B>
</FONT>
<BLOCKQUOTE>
<FONT FACE="ARIAL" SIZE=2 COLOR="#000000">
If you have a friend that you would like to recommend this page to,
or if you just want to send yourself a reminder, here is the easy
way to do it!
<P>
Simply fill in the e-mail address of the person(s) you wish to tell
about $SITE_NAME, your name and e-mail address (so they do
not think it is spam or reply to us with gracious thanks),
and click the <B>SEND</B> button.
If you want to, you can also enter a message that will be included
on the e-mail.
<P>
After sending the e-mail, you will be transported back to the
page you recommended!
</FONT>
<FORM METHOD="POST" ACTION="$SCRIPT_NAME">
<INPUT TYPE="HIDDEN" NAME="call_by" VALUE=$ENV{'HTTP_REFERER'}>
<TABLE BORDER=0 CELLPADDING=1 CELLSPACING=0 >
<TR>
<TD> </TD>
<TD ALIGN=CENTER><B>Name</B></TD>
<TD ALIGN=CENTER><B>E-Mail Address</B><TD>
</TR>
<TR>
<TD><B>You</B></TD>
<TD><INPUT TYPE="TEXT" NAME="send_name"></TD>
<TD><INPUT TYPE="TEXT" NAME="send_email"></TD>
</TR>
__REQUEST__
for ($i=1;$i<$MAXNUM+1;$i++)
{
print <<__STOP_OF_ROW__;
<TR>
<TD><B>Friend $i</B></TD>
<TD><INPUT TYPE="TEXT" NAME="recipname_$i"></TD>
<TD><INPUT TYPE="TEXT" NAME="recipemail_$i"></TD>
</TR>
__STOP_OF_ROW__
}
print <<__REQUEST2__;
<TR>
<TD> </TD>
<TD ALIGN=CENTER COLSPAN=2>
<B>Your Message</B><BR>
<textarea name="message" wrap=virtual rows=5 cols=35></textarea>
<BR>
<INPUT TYPE="submit" VALUE="SEND">
</TD>
</TR>
</TABLE>
</FORM>
</BLOCKQUOTE>
<CENTER>
<FONT SIZE="-1">
Free recommendation script created by<BR>
</FONT>
<A HREF="http://bignosebird.com/"><B>BigNoseBird.Com</B></A><BR>
<FONT SIZE="-1">
<I>The Strangest Name in Free Web Authoring Resources<I><BR>
</FONT>
<P>
</CENTER>
</TD>
</TR>
</TABLE>
__REQUEST2__
}

##################################################################
# NOTHING TO MESS WITH BEYOND THIS POINT!!!!
##################################################################
Thanks

------------------
Jimmy Crow
http://www.homewithgod.com
webmaster@homewithgod.net
Subject Author Views Date
Thread Problems with Birdcast Recommend It install jcrow 3487 Mar 4, 2000, 8:17 AM
Post Re: Problems with Birdcast Recommend It install
Stealth 3316 Mar 4, 2000, 10:08 AM
Post Re: Problems with Birdcast Recommend It install
Stealth 3313 Mar 4, 2000, 11:12 AM
Post Re: Problems with Birdcast Recommend It install
jcrow 3316 Mar 4, 2000, 11:43 AM
Post Re: Problems with Birdcast Recommend It install
Stealth 3320 Mar 4, 2000, 12:44 PM