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.
Results 1 to 5 of 5

Thread: E-mail thing

  1. #1
    New Coder
    Join Date
    Sep 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts

    E-mail thing

    When i click an a e-mail link i want it to add som information to the subject and to the body, something like this (i know it's not right):

    Code:
    ?subject=Take a look at this page I found, ' + document.title + '?body=You can see this
    I want it to be implimented in to this script:

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    
    <!-- This script and many more are available free online at -->
    <!-- The JavaScript Source!! http://javascript.internet.com -->
    
    <!-- Begin
    var user = "username";
    var site = "yoursite.com";
    
    document.write('<a href=\"mailto:' + user + '@' + site + '\">');
    document.write(user + '@' + site + '</a>');
    // End -->
    </SCRIPT>
    Mike //

  • #2
    Senior Coder
    Join Date
    Jul 2004
    Location
    New Zealand
    Posts
    1,315
    Thanks
    0
    Thanked 2 Times in 2 Posts
    Code:
    document.write('<a href=\"mailto:' + user + '@' + site + '?subject=Take a look at this page I found, ' + document.title + '?body=You can see this\">');
    I don't know the specific syntax for passing the subject/body to an email application.

    Plus document.write is bad.
    Forget style. Code to semantics. Seperate style from structure, and structure from behaviour.
    I code to specs, and test only in Firefox (unless stated otherwise).

  • #3
    New Coder
    Join Date
    Sep 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    When i use it like that it puts both subject and body in the subject. Someone else that has an solution?

  • #4
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Code:
    document.write('<a href="mailto:'+ user +'@'+ site +'?subject=Take a look at this page I found, '+ document.title +'&body=You can see this">');
    Hope this helps

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #5
    New Coder
    Join Date
    Sep 2002
    Posts
    34
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yep, it helped! Thanks!


  •  

    Posting Permissions

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