CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate: Re: [rmitchell12] Perl/CGI Email: Edit Log



wickedxter
User

Jul 26, 2012, 6:41 PM


Views: 1231
Re: [rmitchell12] Perl/CGI Email


Code
#!/usr/bin/perl 
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser);

print header;

open FILE, "<", "newsletter.html" or die $!;
my @data = <FILE>;

my $owner_email="robert\@businessinnovationsmo.com";
my $mailprog="/usr/sbin/sendmail";


open (MAIL, "|$mailprog -t") || die "Can't open mail program\n";

#to start writing the email
print MAIL "To: $owner_email\n";
print MAIL "Reply-To: noreply\@nonprofitinsight.com\n";
print MAIL "From: noreply\@nonprofitinsight.com\n";
print MAIL "Subject: Whatever you want, helpful for filtering\n\n";





my $message = <<MailBody;

this is @data

MailBody

print MAIL $message;

close(MAIL);
close FILE;
print "Message has been sent";



(This post was edited by wickedxter on Jul 26, 2012, 6:41 PM)


Edit Log:
Post edited by wickedxter (User) on Jul 26, 2012, 6:41 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives