in reply to Re: How to format email so Outlook renders HTML
in thread How to format email so Outlook renders HTML

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"

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

Replies are listed 'Best First'.
Re: Re: Re: How to format email so Outlook renders HTML
by pinetree (Scribe) on Aug 29, 2001 at 07:47 UTC
    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