About break newsletter text with wordwrap

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
webstyler
Forum Commoner
Posts: 85
Joined: Sat Feb 14, 2004 2:16 am

About break newsletter text with wordwrap

Post by webstyler »

Hello

We break a newsletter text with this code

Code: Select all

$row[text] = wordwrap($row[text], 74, "\r\n");
Question is: there are problem with tag "breaked" ?

ex.

---
(HTA).</p><p align="center"><strong>In this number</strong></p><p
align="left"><strong>1. Myspace:</strong></p><li><a
href="http://www.webstyler.it/files/2_1_myspace.pdf"
target="_blank">News, examples, tutorial online</a>,
<em>Webstyler thread</em> </li><li><a
href="http://www.webstyler.it/files/2_2_ws.pdf"
---

?

Thanks
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

If you are using HTLM for your newsletter why do you need wordwrap()? As I remember wrapped HTML code display the same page as code written in one line (excepting a very very few troubles in IE)
webstyler
Forum Commoner
Posts: 85
Joined: Sat Feb 14, 2004 2:16 am

Post by webstyler »

Gente wrote:If you are using HTLM for your newsletter why do you need wordwrap()? As I remember wrapped HTML code display the same page as code written in one line (excepting a very very few troubles in IE)
With more text If I not break word there are many syntax error as "%20" or link not 'linked'.
I have check and error are where line is break into code..
If I break first there aren't problem :)
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

Gente wrote:If you are using HTLM for your newsletter why do you need wordwrap()? As I remember wrapped HTML code display the same page as code written in one line (excepting a very very few troubles in IE)
E-mails can't have lines longer than 70 characters, though HTML emails will be displayed as if they're lines are longer since all white space in HTML is recognized as a single space.
webstyler wrote:Question is: there are problem with tag "breaked" ?
As long as you only use the three arguments in wordwrap that you are using so far (and you should change the number "74" to "70"), your HTML won't be broken, just separated. HTML can handle the white space, even inside of tags. Where is your error, exactly?
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

superdezign wrote:
Gente wrote:If you are using HTLM for your newsletter why do you need wordwrap()? As I remember wrapped HTML code display the same page as code written in one line (excepting a very very few troubles in IE)
Sorry. You are right. Didn't associate the post with mail(). Hard morning :)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Is there a reason you aren't using a mailing library such as Swift?
Post Reply