Gossamer Forum
Home : Products : DBMan : Customization :

CGI WRAPPED SENDMAIL

Quote Reply
CGI WRAPPED SENDMAIL
After contacting my ISP about Sendmail they told me it was available but it was wrapped then they told me where to find the following programme which they call a sample file to demonstrate the wrapped sendmail. I cannot for the life of me work out how this works. My Isp know absolutely nothing which is pretty poor considering they r one of the biggest telecoms companies in the world. Does anybody on here know how I would use this code with dbman to send emails ? See code Below:-

#! /usr/local/bin/perl

# ident "@(#)wrapper/mailtest.pl, SYM3-wrapper, SYM3:WRAPPER:1, 7 1.1 00/03/13"

use sendmail;

$script = "mailtest.pl";

$|=1;

print "Content-type: text/html\n\n";

$input = <STDIN>;

foreach $tuple (split( /&/, $input ) ) {

my $name;

( $name, $_ ) = split( /=/, $tuple );

tr/+/ /;

s/%([a-fA-F0-9][a-fA-F0-9])/pack('C', hex($1))/eg;

tr/\n\t\f / /s; # compress white space but preserve CRs

s/ ?\r ?/\r/go; # get rid of white space adjacent to CRs

s/^\s//o; # remove leading white space

s/\s$//o; # remove trailing white space

$form{$name} = $_;

}

if ( $ENV{ 'QUERY_STRING' } !~ /action=Send/ ) {

&displayForm("<i>No Result To Display </i>");

exit;

}

$sender = $form{'sender'};

$recipient = $form{'recipient'};

$subject = $form{'subject'};

$message = $form{'message'};

$result = sendmail( $sender, $recipient, $subject, $message);

&displayForm( "<i>Sendmail returned $result</i>" );

exit;

sub displayForm {

local ($text) = @_;

print "<html><head><title>BT Connect Mail Form</title></head>\n";

print "<BODY BGCOLOR=\"#FFFFFF\" TEXT=\"#000000\">\n";

print "<TABLE CELLSPACING=0 CELLPADDING=0 BORDER=0>\n<TR>";

print "<TD align=center colspan=2>\n";

print "<font size=+1><b>Send a message</b></font><br>\n";

print "<i>$text</i>";

print "</TD></TR><TR>\n";

print "<form method=post action=$script?action=Send>\n";

print "<TD align=center width=90>\n";

print "From</TD><TD align=center><input type=text name=sender size=31>\n";

print "</TD></TR><TR>\n";

print "<TD align=center width=90>\n";

print "Mail To File</TD><TD align=center><input type=text name=recipient size=31>\n";

print "</TD></TR><TR>\n";

print "<TD align=center width=90>\n";

print "Subject</TD><TD align=center><input type=text name=subject size=31>\n";

print "</TD></TR><TR>\n";

print "<TD align=center colspan=2>\n";

print "Message<br>\n<textarea rows=6 cols=40 name=message text=data></textarea></br>\n";

print "<input type=submit value=Send>\n";

print "<input type=reset>\n";

print "</TD></TR></TABLE>\n";

print "</body></html>\n";

}

Quote Reply
Re: [jamesamorris] CGI WRAPPED SENDMAIL In reply to
not exactly sure if I can help but JPDeni's mods work well with my sendmail and CGIwrap'd server. You might wanna try one of his. I installed the Secure Password lookup mod that basically creates a random password and sends it via sendmail to the person who is registering and it works great. here's the link:

http://www.jpdeni.com/...s/secure_lookup.html

g'luck

Soil
Quote Reply
Re: [jamesamorris] CGI WRAPPED SENDMAIL In reply to
James

I found your post re; cgi-wrapped sendmail after doing a google search for mailtest.pl I'm trying to get the exact same script working with my cgi wrapped ISP.

Did you get it working? If so, how?! Any info would be appreciated as i've gone grey and ran up a huge phone bill!!

I think we must be using the same ISP since, despite throwing up the wrapped script, they know nothing about how to support it!

Cheers

Ben
Quote Reply
Re: [benone] CGI WRAPPED SENDMAIL In reply to
Does your host provider supply you with the path to sendmail?

I think from what I read above that is all you would need to enter in your .cfg file to get it to work with DBMan.

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/