hmbscully has asked for the wisdom of the Perl Monks concerning the following question:
I'm mostly looking for solutions under the assumption that I can't change the data before I get it, but I'll take any suggestions. I'm still new at this fun called perl, hopefully this is something simple and obvious and explains why i couldn't find any help in the scores of books strewn about. TIA. -W#!/usr/bin/perl $mailprog = '/usr/sbin/sendmail -t'; $admin_email="admin\@email.org"; $subject="Testing the new mass mailer"; $file = "/actapps/suitespot/cgi-bin/sender/returntest3.txt"; $number_sent = 0; open(DATA, "$file") || die "Can't open $file"; # open the file for +reading while($line = <DATA>) { chop $line; ($junk,$email,$message,$survey_url,$login,$password) = split(/\|/, +$line); open (MAIL, "|$mailprog -t") || die "Can't open $mailprog! \n"; print MAIL "Content-type:text/plain\n"; print MAIL "From: $admin_email\n"; print MAIL "To: $email\n"; print MAIL "Subject: $subject\n"; print MAIL "$message\n\n"; print MAIL "URL: $survey_url\n"; print MAIL "Login: $login\n"; print MAIL "Password: $password\n"; close(MAIL); $number_sent++; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: newlines and sendmail
by HyperZonk (Friar) on Aug 17, 2001 at 03:19 UTC | |
|
Re: newlines and sendmail
by E-Bitch (Pilgrim) on Aug 17, 2001 at 02:25 UTC | |
by ChemBoy (Priest) on Aug 17, 2001 at 04:39 UTC |