On Thu, Dec 06, 2001 at 11:27:02PM -0500, Ranga Nathan wrote: > > [forwarded submission from a non-member address -- rjk] > > > From: "Ranga Nathan" <[EMAIL PROTECTED]> > Date: Thu, 6 Dec 2001 22:53:03 -0800 > Subject: HTML Mail > To: "Boston Perl Mongers" <[EMAIL PROTECTED]> > > I have sent mail via Mail::Sender sometime ago. I now need to send HTML mail > like what I receive (yes mostly spam) from others. Can someone point me in > the right direction for the protocol required for this? Is it "Content-Type: > text/HTML\n\n" like CGI or is it something different? I also need to send > attachments in Mime format. I would like to hear from those who have done > this.
The right Content-Type for an HTML message is multipart/alternative, because all HTML mail should have a corresponding plain text part. You may have some HTML sitting in your mail box that you can examine... If not, I've included a sample of the structure below. You can either produce the whole thing yourself, or use something like the MIME-tools package. Ronald From/To/Subject/etc. MIME-Version: 1.0 Content-Type: multipart/alternative; boundary=your_boundary_string_here --your_boundary_string_here Content-Type: text/plain; charset=us-ascii This is a message! --your_boundary_string_here Content-Type: text/html; charset=us-ascii <html> <head> <title>This is a message!</title> </head> <body> This is a message! </body> </html> --your_boundary_string_here--
