Reply to Re: wrapping text

Your name:

Reply:


Posted by Matthew Weier O'Phinney on 08/14/05 06:30

* John Taylor-Johnston <John.Taylor-Johnston@cegepsherbrooke.qc.ca>:
> Folks are complaining mail arrives and text will not wrap. $message
> comes directly from a textarea. Old mail readers, I guess?

Not necessarily old. Many of us use text-based mail readers, where
tradition and usability dictate line lengths of 72-80 characters. Also,
many mail user agents render text/plain without wrapping lines (or make
line wrapping optional).

> How can I make their life better and make the text wrap?

Yep. Investigate http://php.net/wordwrap:

> mail("info@foo.ca", stripslashes($subject), stripslashes($message),
> "Return-Path: <info@foo.ca>\r\nFrom: \"[foo] foo\" <info@foo.ca>\r\nbcc:
> $bcc \r\nReply-To: info@foo.ca \r\n"."X-Mailer: PHP/" . phpversion());

Make "stripslashes($message)" into
"wordwrap(stripslashes($message), 72)".

--
Matthew Weier O'Phinney
Zend Certified Engineer
http://weierophinney.net/matthew/

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация