Do you have a question? Post it now! No Registration Necessary. Now with pictures!
January 23, 2005, 5:01 am
rate this thread
I found this perl script on a website regarding sending emails.
my $query = new CGI;
my $sendmail = "/usr/sbin/sendmail -t";
my $reply_to = "Reply-to: firstname.lastname@example.org";
my $subject = "Subject: Confirmation of your submission";
my $content = "Thanks for your submission.";
my $to = email@example.com;
open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $reply_to;
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $content;
print "Confirmation of your submission will be emailed to you.";
However when I go and run the script from the browser, I don't recieve any
emails. Is this because the script must be posted too, or have I simply
missed something out? My aim is to incorporate it into a larger script which
processes an email automatically, however this part is obviously not
- » FAQ 3.19 How can I free an array or hash so my program shrinks?
- — Previous thread in » PERL Discussions