ItGo.me Focus on IT Recommend

Home > php - how to force for "Text Only" email format while fetching them from gmail server using POP3 protocol?

php - how to force for "Text Only" email format while fetching them from gmail server using POP3 protocol?

2020阿里云最低价产品入口,含代金券(新老用户有优惠),
入口地址https://www.aliyun.com/minisite/goods

Hi I am using Zend_Mail pop3 client to fetch emails from gmail account problem is the content which I get is in HTML format but I want to store only text format . There are to solution I am looking forward to

a) force my pop3 client to retrieve only text message b) conver html into simple text i.e remove all the html tags properly .

Thanks.

php zend-framework email pop3 zend-mail
|
  this question
asked Jul 15 '11 at 12:56 Learner 32 4

 | 

2 Answers
2

---Accepted---Accepted---Accepted---

An email is either in one specific format, or its in "multipart". In every case you must download the whole email. After it, you may either retrieve the text-part (if its multipart or text), or you must parse the html-source (or just strip_tags), if its html-only.

Zend_Mail_Part::getPart()


|
  this answer
answered Jul 15 '11 at 13:10 KingCrunch 77.1k 12 112 145

 | 

Whether mail is html or test is decided by the sender, not the recipient. Sometimes mail will be "multipart" where there is both a text and html version and you can choose to view either, but basically, you get what you get. Zend is PHP and allows plugins, so you might make use of a PHP html-to-text converter. I've seen some code on the web.


|
  this answer
answered Jul 15 '11 at 13:14 Steve C 627 3 6

 | 

oriUlr:http://stackoverflow.com/questions/6707271/how-to-force-for-text-only-email-format-while-fetching-them-from-gmail-server

------splitte line----------------------------