in reply to How to format email so Outlook renders HTML

You should check out this thread which answers just this problem. Multi-Part email with Attachments using MIME::Lite The key words are 'multipart/alternative' and 'Mime' if you want to do a search. The long and the short of it is that a multipart/alternative MIME format email has a plain text bit and an HTML bit. If the email client can do HTML it displays the HTML, if not it displays the plain text. This will fix your problem. There is full code at the above node. If you want to add a Word doc, XL file or even a Powerpoint slide you can do that to with the code presented.

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

  • Comment on Re: How to format email so Outlook renders HTML

Replies are listed 'Best First'.
Re: Re: How to format email so Outlook renders HTML
by clscott (Friar) on Aug 29, 2001 at 06:01 UTC
    I've had to do this before and I found Mime::Lite to be extremely helpful.

    If you just want to send the html as the body of the e-mail just omit the part of the above mentioned tutorial that inserts the text/plain portion.

    But I caution you, only send this to people that you know have the right mail client to handle it or you may have some irate plain text email users on your hands!
    --
    Clayton aka "Tex"

      MIME::Lite is definately the way to go. Take a look at the examples...

      One solution to the plain text/html quandry is to include a text/plain message first and then the text/html so that your email message looks something like:
      multipart/mixed
      - text/plain
      - text/html

      ### Create the multipart "container":
          $msg = MIME::Lite->new( 
                       From    =>'me@myhost.com',
                       To      =>'you@yourhost.com',
                       Cc      =>'some@other.com, some@more.com',
                       Subject =>'A message with 2 parts...',
                       Type    =>'multipart/mixed'
      		 );
          
          ### Add the text message part:
          ### (Note that "attach" has same arguments as "new"):
          $msg->attach(Type     =>'text',   
                       Data     =>$text_msg,
      		 );  
           
          ### Add the HTML part:
          $msg->attach(Type     =>'text/html',
                       Data     =>$html_msg,
      		 );
      
      Oren