Results 1 to 3 of 3

Thread: Email Subject Line Code

  1. #1
    Join Date
    Aug 2012
    Abington, MA

    Post Email Subject Line Code

    I have a web site and on each page I have email contact links (Tech Support, Contact Me, etc). What I want to do is when the end user clicks on the link, the email subject line will display a concatenated string that includes the page title.

    I know I can hard code the subject line with the page title (without concatenating anything):
    <a href="techsupport:contactme@example.com?subject="Technical Issue With Poetry Page">Tech Support</a>

    But I don't want to hard code each of the links on every page. Is there a way to concatenate using the Title tag? Would I use StringBuilder? If so, what is the correct syntax?

    I am currently using Dreamweaver to develop my site.

  2. #2
    Join Date
    Aug 2012
    Abington, MA
    Is there a different language I should use for this?

  3. #3
    Join Date
    Jun 2006
    Boston, MA
    php would be easiest.. otherwise this might work for you.

    HTML Code:
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>mailto with location</title>
    <script type="text/javascript">
    var subj = encodeURI("Have a look at this:-  " + window.location.href);
    var body = encodeURI("You might find this interesting:- ") + "&#37;0A%0A" + encodeURI(window.location.href);
    document.write("<a href=\"mailto:?subject=" + subj + "&amp;body=" + body + "\">Send link to a friend</a>");
    <noscript>You do not have Javascript enabled so you cannot send the message.</noscript>
    "Problems cannot be solved by the same level of thinking that created them.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

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