Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorehkucia
    • CommentTimeMay 19th 2008 edited
     permalink
    Using a simple script that opens the users e-mail app., than adds the page title to the subject line and a link to the page in the body of the e-mail.

    This works great in a current site that I have but now it will not work in a new layout that I am developing.
    Only places the title of the page in the e-mail subject line with no link reference in the body.

    Any thoughts? I do not have the option of creating a server side e-mail form for this client.

    Here is the script I am using:

    <script type="text/javascript">
    function mailpage()
    {
    mail_str = "mailto:?subject= " + document.title;
    mail_str += "&body=Additional information on " + document.title;
    mail_str += ". You can view it at, " + location.href;
    location.href = mail_str;
    }
    </script>

    In the body for the link I place: <a href="javascript:mailpage()"><img src="images/emailimg.gif" width="20" height="16" /> E-mail this Page</a>
    • CommentAuthorsoulID
    • CommentTimeMay 20th 2008
     permalink
    What's not working?

    Your code works fine, other than that the subject line doesn't appear. Remove the space after "subject= " and it should work then:

    mail_str = "mailto:?subject=" + document.title;
    • CommentAuthorlgarin
    • CommentTimeDec 16th 2008
     permalink
    I'm attempting to use this code on my site. I am encountering an error message in AOL (which is my default mail program). It says:
    "The file may not be supported by AOL. AOL will try to open it as a text file if you choose to continue." I then select "yes" to continue.
    I then get a second error message which says "This file is too large to open sing AOL. Please open the file using another application."
    This creates an endless loop in AOL.

    Anyone have any idea why this is occurring?
    • CommentAuthorwebcare.me
    • CommentTimeJan 15th 2009
     permalink
    I have been banned cause I'm an idiot
    It will work fine,i have checked it,it worked fine for me. Ok do you want me to give you some another java script for this,even i can wrtie php script for you.
Add your comments
    Username Password
  • Format comments as (Help)