Guest_imported
New member
- Jan 1, 1970
- 0
- 0
- 0
My knowledge of perl is fairly limited. I'm trying to setup a mailing list for my friend's band. The part that is causing me problems is the actual sending of the mail. I cut out all of the other stuff, so all this script is supposed to do is send an e-mail and return html. Most of the code is just stuff that I have seen in other scripts which is why I am so confused as to why it isn't working. It displays the html, but I never get an e-mail.
Any ideas?
Thanks
#!/usr/local/bin/perl
###################
# Program Variables
$mail_prog = `/usr/bin/sendmail`;
###################
# Program Execution
&send_mail;
&ret_html;
exit;
#################
# Sends an e-mail
sub send_mail {
open(MAIL,"|$mail_prog -t"
print MAIL "To: dpfrey\@home.com\n";
print MAIL "From: \<form submit\>\n";
print MAIL "Subject: HI there\n";
print MAIL "Mime-Version: 1.0\n";
print MAIL "X-Mailer: Limestone Mailer v1.0\n";
print MAIL "Content-Type: text/plain;\n\n";
print MAIL "This is the body.\n";
close(MAIL);
}
##########################
# Returns an HTML document
sub ret_html {
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print " <title>Mail</title>\n";
print " <link href=\"stylesheet.css\" type=\"text/css\" rel=\"stylesheet\">\n";
print "</head>\n";
print "<body bgcolor=\"#000000\">\n";
print "Mail has been sent\n";
print "</body>\n";
print "</html>\n";
}
Any ideas?
Thanks
#!/usr/local/bin/perl
###################
# Program Variables
$mail_prog = `/usr/bin/sendmail`;
###################
# Program Execution
&send_mail;
&ret_html;
exit;
#################
# Sends an e-mail
sub send_mail {
open(MAIL,"|$mail_prog -t"
print MAIL "To: dpfrey\@home.com\n";
print MAIL "From: \<form submit\>\n";
print MAIL "Subject: HI there\n";
print MAIL "Mime-Version: 1.0\n";
print MAIL "X-Mailer: Limestone Mailer v1.0\n";
print MAIL "Content-Type: text/plain;\n\n";
print MAIL "This is the body.\n";
close(MAIL);
}
##########################
# Returns an HTML document
sub ret_html {
print "Content-type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print " <title>Mail</title>\n";
print " <link href=\"stylesheet.css\" type=\"text/css\" rel=\"stylesheet\">\n";
print "</head>\n";
print "<body bgcolor=\"#000000\">\n";
print "Mail has been sent\n";
print "</body>\n";
print "</html>\n";
}