Thanks for the response Peter!

This is being performed through a browser as part of an admin tool and when
I added the below code as suggested the entire file is sent but all the MIME
info is displayed on the screen. How can I eliminate this, as it would just
confuse the user.


This is what I added after the shebang line:
BEGIN { 
        $| = 1; print "Content-type: text/html\n\n"
}       



I put it at the beginning of the subroutine that sends out the email but
zero are sent out:
                foreach my $email_address (@email) {
                $| = 1; print "Content-type: text/html\n\n"
                open (MAIL, "| /var/tmp/sendmail -oi -t -X
/var/tmp/sendmail_email.log") || display_error("Mail
error", "Can't open sendmail $!");
                print MAIL "To: $email_address\n";
                print MAIL "From: $from\n";
                print MAIL "Cc: \n";
                    print MAIL "Subject: $subject_message\n\n";
                print MAIL "$email_text\n";
                close (MAIL) || display_error("Mail error", "Can't close
sendmail $!");
                        }

Any advice would be appreciated,

Regards,
Mike Stussie


> -----Original Message-----
> From: Peter Scott [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, May 21, 2001 2:34 PM
> To:   Stussie, Mike; [EMAIL PROTECTED]
> Subject:      Re: error using sendmail
> 
> At 02:17 PM 5/21/01 -0500, Stussie, Mike wrote:
> >I am trying to send an email to users based on a list of emails that have
> >been read into an array. The array contains about 600 records but it
> abends
> >at around 200.
> 
> Woo, I'll answer someone who knows what ABEND means :-)
> 
> Your script is producing output that violates the HTTP protocol.  Rather 
> than a whole song and dance about this (which takes about a chapter - I 
> know, there's a chapter on it in my book :-)  just put this into your 
> script after the #! line:
> 
> BEGIN { $| = 1; print "Content-type: text/plain\n\n" }
> 
> and the next time you run it you should see the reason.
> --
> Peter Scott
> Pacific Systems Design Technologies
> http://www.perldebugged.com


***************************************************************************************
WARNING:  All e-mail sent to and from this address will be received or
otherwise recorded by the A.G. Edwards corporate e-mail system and is
subject to archival, monitoring or review by, and/or disclosure to,
someone other than the recipient.
***************************************************************************************

Reply via email to