• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

CGI ..

thirtythree

Diamond Member
I haven't ever used CGI and am wondering if there is a script I can download that will send submissions from a form to an e-mail address. Or are there any free services such as FormBuddy without popup ads? How secure are these services (if at all)? How secure is submitting information directly to an e-mail address? I won't be using it for credit card numbers or anything, but possibly e-mail addresses and phone numbers.

Thanks.
 
Something like this should work:


#!/usr/bin/perl

use strict;
use CGI qw🙂standard);

my @names = param();

my $b;

foreach my $line(@names){
$b .= "$line: "
$b .= param($line);
$b .= "\n"
}

&send_email("user\@place.com", "person\@sender.com", "Form thing", $message);

print header;
print "Form sent";

sub send_email{
my ($to, $from, $subject, $message) = @_;
use Net::SMTP;

my $smtp = Net::SMTP->new('localhost');
$smtp->mail("$from");
$smtp->to("$to");
$smtp->data();

$smtp->datasend("To: $to\n");
$smtp->datasend("From: $from\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("\n");

$smtp->datasend("$message");
$smtp->dataend();
$smtp->quit;
}
 
Thanks, but how would I go about implementing that? I honestly don't have a clue .. perhaps you could point me to some tutorials?
 
Back
Top