Skip to main content
Participant
April 3, 2007
Question

AARGH! Need line breaks in email message

  • April 3, 2007
  • 2 replies
  • 406 views
I have made an email form on a flash site using the 'mailto' function to send the input from the text fields to an email program. Works perfectly when tested offline in Flash. However, when it runs online in the browser and the email program is launched, there are no line breaks in the message body.

For example, the body input should be formatted:

Hi,

How are you?

I'm great.

However, it ends up formatted like this: Hi,How are you? I'm great.

AARGH! How do I get the line breaks to match the user's input?

Here's my code:

on (release) {
getURL("mailto:mail@mail.com?subject="+subject+"&body="+body);
}

This topic has been closed for replies.

2 replies

kglad
Community Expert
Community Expert
April 4, 2007
use split("\r").join("\n") on your textfield's text property before executing your getURL() function.
Participating Frequently
April 3, 2007
try this

Hi,\n\nHow are you?\n\nI'm great.
Participant
April 4, 2007
..

Sorry....I could have been clearer with my description.

The "Hi, how are you..." text is an EXAMPLE of what a user might input into the $body field. The problem is that when the user inputs text with line breaks, the line breaks disappear when loaded into the email program.