On Sun, Feb 02, 2003 at 07:54:31PM -0800, Palit, Nilanjan wrote: > This question is not directly related to Perl, but I'm hoping that > someone here can answer it. > > I have written a tool in Perl, that runs on Unix, to generate daily > roll-up reports and mail it out to a distribution list. Most of the > recipients use Microsoft Outlook to read the reports. I have received > several requests for formatting the message, e.g. with bold or italic or > colored or different sized fonts, to make it more readable. I have very > few ideas on how to go about doing that. One option may be to generate > (via Perl) a HTML formatted message. But how would I get Outlook to > recognize that as a HTML message and not a plain text message? Any ideas > would be greatly appreciated.
Both of the proposed solutions so far would have you sending HTML-only email. Please do not do this; email which contains HTML without a corresponding plain text part is malformed. Instead, you should structure your email to include the HTML and a plain-text alternative. For example: From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Message Content-Type: multipart/alternative; boundary="=====Some-MIME-boundary-that-will-not-appear-in-the-content." Mime-Version: 1.0 --=====Some-MIME-boundary-that-will-not-appear-in-the-content. Content-Type: text/plain; charset="us-ascii" This is the body of the message. --=====Some-MIME-boundary-that-will-not-appear-in-the-content. Content-Type: text/html; charset="us-ascii" <html><head><title>Message</title></head> <body> <b>This is the body of the message.</b> </body> </html> --=====Some-MIME-boundary-that-will-not-appear-in-the-content.-- You can either build the message "by hand", with whatever MIME boundary you choose, or use one of the MIME modules from CPAN. If you go the first route (which is really quite easy), note that each occurence of the MIME boundary in the message is preceeded by --, and the final occurence is also followed by --. Ronald _______________________________________________ Boston-pm mailing list [EMAIL PROTECTED] http://mail.pm.org/mailman/listinfo/boston-pm

