Mazhar wrote:

Hi Folks,
       i have a requirement where in i need to send alerts to a set
of users for which i have developed a script and it is working fine.
For the body of the mail i am writing into a text file everytime and i
am sending across using the command,

cat "textfilename" | mail -s "Subject" set of users

    This above is working fine i need help for sending the same
textfile as a HTML file as the body of the mail please help me.

Thanx in Advance

Regards
Mazhar

Hi Mazhar,

What I do is open a filehandle to the sendmail application, then I print in the headers I want.
You can be very flexible with it and there really is no guess work.

Here is a quick example.
open (MAIL, "|/usr/sbin/sendmail $recipient") or die "Could not open sendmail";
           print MAIL "To: $recipient\n";
           print MAIL "From: $sender\n";
           print MAIL "Subject: $subject\n";
           print MAIL "Content-Type: text/html\n\n";
           print MAIL "$html\n";
           print MAIL "\n.";
           close MAIL;

That should work just fine, it is only for one recipient but I think you just have to make sure they are seperated by spaces.

Hope that helps,
-JB

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to