troubleshooting Question

Confused and lost on Sendmail and Perl

Avatar of kidfist
kidfist asked on
Scripting Languages
5 Comments1 Solution348 ViewsLast Modified:

I am very new at this and trying to work with books for making PERL scripts. I am trying to get a script to write to a text file and send and e-mail. I can get the script to write to a text file.  However I cannot get the perl script to send an email.  I was using sendmail. Then I later found out That was for unix only and not windows. So now what? If Sendmail is for unix only then what do I do? Could someone look at my code and give me a hand. This is job related so it is important.

foreach $ab (@gold) {
$ri=~tr/+/ /;
open(MAIL, "|/usr/lib/sendmail -oi -t ")|| die "Cannot start sendmail: $!\n";


print MAIL "To: $email \n";
print MAIL "Subject: New Clockin\n";
print MAIL "Clockin=$days[$wday], $months[$mon] $mday, $year, $timey:$timei:$timee\n";

close MAIL or die $!;
print "Content-type: text/html\n\n";
@days = ("Sunday","Monday","Tuesday","Wednesday","Thursday",

@months = ("January","February","March","April","May","June",

"July","August","September","October","November", "December");

@days = ("Sunday","Monday","Tuesday","Wednesday","Thursday",
@months = ("January","February","March","April","May","June",
($sec,$min,$hr,$mday,$mon,$year,$wday,$yday,$isdst) =
$year = $year + 1900;
print TECH
Clocked in at $days[$wday], $months[$mon] $mday, $year, $timey:$timei:$timee&

print qq ~CLICK HERE(<A href="">CO5ROUTES.HTML</A>)~;
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 5 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros