Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 1 of 2 12 LastLast
Results 1 to 15 of 17
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Multi lines in email body

    Hi,

    By this:"mailto:xyz@abc.com&SUBJECT=+hellotxt&BODY=I NEED MORE THAN A SINGLE LINE!" I can invoke the client email app. to send me a message.

    I wish to include several lines of information in the email body. No fancy formatting but text with line breaks. Is this possible? I tried '\n' but no luck. Any help is appreciated.


    Will

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts
    mailto:xyz@abc.com&SUBJECT=hellotxt&BODY=Line1%0D%0ALine2

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Close but not yet

    Thanks very much.

    I have tried to put %0D%0A in but it have no effect. I also tested with an escape char '\'. no luck either.

    What I did and failed:
    <script language="JavaScript1.1">
    var todayTxt1 = "This is line 1";
    var todayTxt2 = "This is line 2";
    var p1 = "mailto:abc@xyz.com&SUBJECT=User Name: ";
    p1 += "Mr. Confused";
    p1 += "&BODY=";
    p1 += todayTxt1;
    p1 += "%0A%0D";
    p1 += todayTxt2;
    location = p1;
    </script>

    I am using IE5 and Outlook 2000.

    Is it possible you can give me a few lines of examples. Thanks in advance.


    Will

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts

    Re: Close but not yet

    is this a typo, you typed & instead of ? after the email addr

    <script language="JavaScript1.1">
    var todayTxt1 = "This is line 1";
    var todayTxt2 = "This is line 2";
    var p1 = "mailto:abc@xyz.com?SUBJECT=User Name: ";
    p1 += "Mr. Confused";
    p1 += "&BODY=";
    p1 += todayTxt1;
    p1 += "%0A%0D";
    p1 += todayTxt2;
    location = p1;
    </script>

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not typo but I don't know why the ?

    Hi,

    On my system I do have the & and not ?.

    Outlook comes out ok but without the line break. Alert box also suggests the line SUBJECT etc. ok???

    How can I place a screen capture on this page?


    Will

  • #6
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Glenn,

    I might have mis-read your message. So I tried the '?' instead of '&' but it seems not making any difference when it is before the word SUBJECT=. The effect is different if it is before BODY=.



    Will

  • #7
    New Coder
    Join Date
    Jul 2002
    Location
    I forgot ;)
    Posts
    35
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post A new part...

    try this:

    Code:
    <script language="JavaScript1.1">
    function sendmail(mail, subject, body){ 
    var todayTxt1 = "This is line 1"; 
    var todayTxt2 = "This is line 2"; 
    var p1 = "mailto:"
    p1 += mail
    p1 += "?SUBJECT="; 
    p1 += subject; 
    p1 += "&BODY="; 
    p1 += body; 
    location = p1; 
    }
    </script>
    
    <p><a href="javascript:sendmail('me@me.com','hello world', 'this is the body')">tim</a></p>
    Just, how can i do it if i create new lines in the body?
    PM Me if you want the new URL for my forum!

  • #8
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    The question is how to line break.

    Yes, you're right. The problem is how to do a line break??


    Will

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts

    Re: The question is how to line break.

    can you post the code again?

    if you alert(p1), the output should be:

    mailto:abc@xyz.com?SUBJECT=User Name: Mr. Confused&BODY=This is line 1%0A%0DThis is line 2

  • #10
    New Coder
    Join Date
    Aug 2002
    Location
    Sydney, Australia.
    Posts
    13
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Don't know if this helps...

    I found this while looking for an answer to my previous question (*hint * hint*)

    here's the address:
    http://www.webreference.com/js/tips/001023.html



    Here's my question for those that want to give it a shot (pleaaasee)

    Need some help with a form and the mailto action. (links to code included)

  • #11
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    line break story

    Hi Glenn,

    Here is the code I'm playing with,

    <script language="JavaScript1.1">
    var p1 = "mailto:abc@xyz.com?SUBJECT=User ID: ";
    p1 += "Is Me";
    p1 += "&BODY=";
    p1 += "first line";
    p1 += "%0D%0A";
    p1 += "second line";
    alert(p1);
    location = p1;
    </script>

    The alert show '?' ok but I still get one line in the body. Do you have the line break? If yes, what mail client you're using. Mine is Outlook 2000.


    Will

  • #12
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts

    Re: line break story

    i used Netscape Messenger and it has a line break.

    try reversing the hexadecimal notation to %0D%0A as what the link that reptilemart provided, says.

  • #13
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer At last the story is ending...

    All is clear now. Netscape gives me the line break but not IE 5.

    Thanks for your help all along.


    Cheers,

    Will

  • #14
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,042
    Thanks
    0
    Thanked 250 Times in 246 Posts

    Re: At last the story is ending...

    how did you solve it in IE5? did the reversing work?

    Originally posted by wrothwell
    All is clear now. Netscape gives me the line break but not IE 5.

    Thanks for your help all along.


    Cheers,

    Will

  • #15
    New Coder
    Join Date
    Jul 2002
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Well, IE 5...

    It doesn't work no matter how I place the linefeeds. If I reserve them, Netscape 6.2.3 seems to give me an 'extra line' but IE is stubborn.

    I haven't solved the problem yet.



    Will


  •  
    Page 1 of 2 12 LastLast

    Posting Permissions

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