Sending TEXT and HTML e-mail messages

I'm using PEAR:Mail and PEAR:Mail_Mime to send e-mails in both text and html versions, expecting the mail client (Outlook 2003) to display the right format -- depending on how the client is set up.  

I'm confused about how that's supposed to work.  

I set my Outlook 2003 to display all incoming e-mails in plain text and then I sent an e-mail to myself using my PHP script.  Instead of receiving the 'text-only' e-mail, as I expected, I received the HTML version of the e-mail with all of the HTML tags simply stripped out.  With my e-mail client set to receive only plain-text e-mails, should the text-only version of the e-mail have appeared instead of the stripped-down HTML version?  

I guess I don't understand, in which circumstances, the text-only version would appear when sending a multipart e-mail message.

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

You are correct in your understanding of how multipart MIME emails are supposed to work.  So, apparently something is wrong in the implementation or your Outlook setup.

Have you tried setting Outlook to display in HTML to verify that it still displays the HTML version?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
marcparilloAuthor Commented:
Yes, I've successfully switched from HTML to Plain Text, but I never see the "Text" e-mail that was sent -- only the HTML version with the tags stripped out.  The only way I know to switch between text and html in Outlook is:  Tools -> Options -> Preferences -> E-Mail Options -> Check "Read all standard mail in plain text"

I don't see any other way to force Outlook to show text instead of HTML, so I think I'm doing it correctly.
I think you are doing it correctly. I assume you've tested with a different mail client, configured to view text messages and that works ok? If so, you've proven that your implementation is correct.

Outlook, like most mail clients, won't automatically "switch" between text and HTML with multipart MIME. I believe the idea is that unless you specify you want text messages, it will display the HTML component.
marcparilloAuthor Commented:
So, a good test would be to see if the text version of the e-mail shows up in a client such as Alpine?  If the text-only message doesn't appear in Alpine, then I'm doing something wrong, right?  Is there a better text-only client to work with?
marcparilloAuthor Commented:
Thank you for your input!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.