OK, it's more clear now :) Well, Flash uses \r (= character 13 or
0x0D) for line-breaks in textfields (as Macinthos does), even \n
(= character 10 or 0x0A) is converted to \r when placed into a textfield.
On the other hand the SMTP protocol and most of the e-mail clients use
\r\n for line-breaks (as Windows, DOS, etc) and a simple \n or \r will
not start a new line (there are some e-mail clients however which deal with
a simple \n, too). So really, you need to replace simple \r
characters to \r\n on client-side or server-side - it is your choice.

In ActionScript it can be achieved by a simple line:

bodyText = bodyText.split("\r").join("\r\n");

In PHP use

$bodyText = ereg_replace("\n\r|\r\n|\n|\r", "\r\n", $bodyText);

which replaces any type and combination of line-break characters
(\r on Macs, \n on Unix/Linux, \r\n on Windows) with \r\n.

  Attila

  
HPB> Probably Attila, and I´ll try to explain better.
HPB> 
HPB> If I come to my site (that uses Flash/PHP to send e-mail), type a message
HPB> like this:
HPB> 
HPB> "Hey Attila,
HPB> I can´t keep the e-mail
HPB> looking like this,
HPB> in 4 lines."
HPB> 
HPB> It will come to the email like this:
HPB> 
HPB> "Hey Attila, I can´t keep the e-mail looking like this, in 4 lines."
HPB> 
HPB> So, where the user typed "enter" key, there´s only a space, not a line
HPB> break.
HPB> Is there a way to tell PHP to send the e-mail with line breaks on the exact
HPB> place?


_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to