Not signed in (Sign In)

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

Categories

Vanilla 1.1.4 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;
Add your comments
    Username Password
  • Format comments as (Help)