Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML to plain text (for email)

Tags:

html

text

php

Do you know any good HTML to plain text conversion class written in PHP?

I need it for converting HTML mail body to plain text mail body.

I wrote simple function, but I need more features like converting tables, adding links at the end, converting nested lists…

-- regards
takeshin

like image 341
takeshin Avatar asked Dec 18 '09 19:12

takeshin


People also ask

How do I send an email to plain text?

To send an email in plain text in Gmail, compose a message as you normally would. At the bottom of the compose window, click the three-dot menu and then click Plain text mode. This setting acts as a toggle. To de-activate plain-text mode, re-select the menu option.

Should email be HTML or plain text?

If you want visually appealing emails, the HTML format is for you. If you're going to deliver a more toned-down, straightforward message, you're better off using plain text emails. You can also use hybrid emails — HTML emails with minimal formatting and look like plain text emails.


1 Answers

A particular mail sending implementation around here simply spawns lynx with the HTML and uses its output for the text version. It's not perfect but works. You might also use links or elinks.

like image 152
Joey Avatar answered Oct 20 '22 00:10

Joey