D
dawnofdigital
Hi, I'm new to cgi/perl and I'm wondering how to send an email through
a perl program to a future user on my site. I've been experimenting and
so far I've gotten the following, but it doesnt seem to be working. Can
anyone point me in the right direction with this little script?
#!/usr/local/bin/perl -w
use CGI;
$cgi = new CGI();
print $cgi->header();
use Net::SMTP;
my $adress = "dawnofdi\@dawnofdigital.net";
my $smtp = Net::SMTP->new('localhost');
$smtp->mail("dawnofdi\@dawnofdigital.net");
$smtp->to("dawnofdigital\@gmail.com");
$smtp->data();
$smtp->datasend("From: dawnofdi\@dawnofdigital.net\n");
$smtp->datasend("To: dawnofdigital\@gmail.com\n");
$smtp->datasend("Subject: Email Script Test\n");
$smtp->datasend("\n");
$smtp->datasend("If you are reading this, then emailsend.cgi works!");
$smtp->dataend();
$smtp->quit();
print "successfully sent to dawnofdigital\@gmail.com";
a perl program to a future user on my site. I've been experimenting and
so far I've gotten the following, but it doesnt seem to be working. Can
anyone point me in the right direction with this little script?
#!/usr/local/bin/perl -w
use CGI;
$cgi = new CGI();
print $cgi->header();
use Net::SMTP;
my $adress = "dawnofdi\@dawnofdigital.net";
my $smtp = Net::SMTP->new('localhost');
$smtp->mail("dawnofdi\@dawnofdigital.net");
$smtp->to("dawnofdigital\@gmail.com");
$smtp->data();
$smtp->datasend("From: dawnofdi\@dawnofdigital.net\n");
$smtp->datasend("To: dawnofdigital\@gmail.com\n");
$smtp->datasend("Subject: Email Script Test\n");
$smtp->datasend("\n");
$smtp->datasend("If you are reading this, then emailsend.cgi works!");
$smtp->dataend();
$smtp->quit();
print "successfully sent to dawnofdigital\@gmail.com";