Gossamer Forum
Home : Products : Links 2.0 : Customization :

sendmail not working with Recommend it mod.

Quote Reply
sendmail not working with Recommend it mod.
Hi,

please see this code with the birdcast.cgi recommendit modification for links 2.0

Code:
# 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/lib/sendmail";
#
# BUT NEVER BOTH!!!!!!

# @okaydomains=("http://www.tylertx.net", "http://tylertx.net");

$SCRIPT_NAME="http://www.tylertx.net/links/cgi/birdcast.cgi";
$SITE_NAME="East Texas Online";
$SITE_URL="http://www.tylertx.net/links/";
$ENDLINE="";
$MAXNUM=5;
$LOGFILE="reflog.txt";

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


&valid_page; #if script is called from offsite, bounce it!
&decode_vars;
%rec = &get_record($fields{'ID'});
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.
my $carbon = "Bcc: pres\@tylersites.com";
$subject = "Web Page Recommendation 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:

Site Name: $rec{'Title'}
Site Location: $rec{'URL'}
Site Description: $rec{'Description'}


__STOP_OF_MAIL__

if ($fields{'message'} ne "")
{
$msgtxt .= "Here is a personal message from $fields{'send_name'}....\n";
$msgtxt .= "--------------------------------------\n\n";
$msgtxt .= "$fields{'message'}\n\n";
$msgtxt .= "--------------------------------------\n\n";
}
$msgtxt .= "$SITE_NAME\n";
$msgtxt .= "$ENDLINE\n";
$msgtxt .= "$SITE_URL\n\n";
$mailresult=&sendmail($fields{send_email}, $fields{send_email}, $fields{$recipemail}, $SEND_MAIL, $subject, $msgtxt, $carbon);

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

}
}

When I fill out the form to send I tested it with my own email address and I am not receiving anything. The REFLOG txt file that is generated from this is showing activity but no actual mail is coming through.

Can someone help with this.. Thanks

James
Quote Reply
Re: sendmail not working with Recommend it mod. In reply to
Is your path to sendmail correct?


------------------
Regards,
Brian
mjordn12@aol.com

Quote Reply
Re: sendmail not working with Recommend it mod. In reply to
yes, it is correct.. i even tried /usr/bin/sendmail and that does not work.

odd???

thanks James
Quote Reply
Re: sendmail not working with Recommend it mod. In reply to
  $SEND_MAIL="/usr/lib/sendmail";

In deadlinks.cgi they have something like this.


$mailprog = "|/usr/lib/sendmail -t -oeq";

would that coding work? It did for me in deadlinks.cgi


gerardo
Quote Reply
Re: sendmail not working with Recommend it mod. In reply to
sorry.. that coding is not found in birdcast.cgi....

i am at a loss.

any input is great, i will try all tips.

thanks

james
Quote Reply
Re: sendmail not working with Recommend it mod. In reply to
Have you tried using the SMTP setting instead of sendmail?
Quote Reply
Re: sendmail not working with Recommend it mod. In reply to
i sure have.. both ways.. i do not know what is wrong... really strange.. if you could show me the code you use as compared to mine.. let me try it that way.. dont know if you would want to release your code though..

thanks
james