SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Hybrid View

  1. #1
    SitePoint Member Toxical's Avatar
    Join Date
    Apr 2002
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    newline in an email msg

    Hi all

    I've got my first question now

    i have a contact form on my site in which the user can write her name, her email adress und her message she wants to send me.(unfortunately i haven't got PHP or any other server side language running on the server)

    now i want to build an email string according to these variabales got from the form, here's my code

    Code:
    function build_mail()
      {
      form = document.form1;
      name = form.name.value;
      email = form.email.value;
      nachricht = form.nachricht.value;
      
      body = "Hallo,"+name+" [ "+email+" ] schrieb folgende Nachricht: "+nachricht;
      subject = "Mail von konfi.nes-evangelisch.de";
      alert(body);
      alert(subject);
      location = "mailto:e.-schlemm@t-online.de?subject="+subject+"&body="+body;
      }
    the alert's are just set to see if the variables are built correctly, and surely they are

    the problem is, how i can do it, that the newlines. which the user writes in the textarea field for the message, are still there in the email, which is built by javascript and is displayed in the user's standard email client.? "\r\n" doesn't work as well as "\n","\r" or"<br>".

    I've got no more idea, i hope u can help me out


    P.S. plz excuse my bad english skills, i hope it's still understandable

    P.P.S. If I'm talking about a "user" or a " person", do i use him/his oder her/her?

    ok
    that was all

    THX a lot
    I beg your pardon for my bad English

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you tried "\n\n"?

    That's two newline characters. That SHOULD give you a full empty space between lines.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Member Toxical's Avatar
    Join Date
    Apr 2002
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    doesn't work for me

    you can have a look at the site http://toxic.homeip.net/konfi/index.html -> then go "contact" --> "em@il"

    there you can enter a name, an email and a msg text. when you click submit , your email client will open , with a text and subject predefined, but the newslines you will probably have written in the textare won't be still there

    hope u can help me

    THX a lot


    P.S. The site will be available under the given URL only until 3.00 a.am approximately.

    then the url will probably change, but i gonna update it as soon as possilble, so that u will always see the right URL, i hope.
    I beg your pardon for my bad English

  4. #4
    SitePoint Member Toxical's Avatar
    Join Date
    Apr 2002
    Posts
    20
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haven't you got any more ideas? it's quite important to get this problem solved
    I beg your pardon for my bad English


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •