I am using Php - v 5.6.25 and using localhost. I am extracting data from the body of the email message and I know that it could be sent as plain text or HTML.
Is it possible to detect if it is text or HTML and convert to plain text ??
Thank you so much...
Chat / IMHTMLPHP
Last Comment
MarthaJ Sayers
8/22/2022 - Mon
David Favor
Simple solution is to run all your messages through the html2text tool.
Any text will pass through unaffected. Any HTML will be converted to text.
MarthaJ Sayers
ASKER
Thank you for responding. There are quit a few of them. A bit confusing. I am using PHP, the page will be eventually be executed as a scheduled task. What one do you recommend ?? would I have to load on server ??
Thank you all for responding and I apologize for not replying sooner and for being too glib in my question.
I live way out in the country, work at home and we had a power outage.
I will clarify:
2. There are several html2text type tools. I was wondering what the best was to use.
3. The page I am creating using PHP will be executed a as unattended task on server.
4. I know how to strip HTML and convert to text but I thought there might be an easier way
other then a third party tool. I too, do not executing 3rd party tools of that nature, from inside coding
I understand about the Content-Type: info - helps alot with some tasks with emails.
And I like it causes it is helpful to know the details of how to use and its usefulness.
But yes, you are very right about all the info to google.
You both have been helpful.
I decided not to use a third-party tool.
Thank you both very much.
Any text will pass through unaffected. Any HTML will be converted to text.