www.webdeveloper.com
Results 1 to 2 of 2

Thread: How do I email (with javascript) html that doesnt' appear as tags?

  1. #1
    Join Date
    Dec 2010
    Posts
    4

    How do I email (with javascript) html that doesnt' appear as tags?

    I have a webpage that shows a table (actually an asp.net gridview with several rows in different colors). I had the idea of putting an EMAIL button on the page, which would open the user's email program, and put the gridview into it. That way, the user could email what he sees to someone else who doesn't want to be bothered with visiting the website. So I did this:
    function tryToEmail() {
    location.href = "mailto:SOMEBODY@domain.com?subject='Here are comments I made on a video'&body='Here is a video that I commented on: '" + document.getElementById('easytoselect').innerHTML;
    return true;

    }
    the gridview has an ID, but I didn't know to get at it with javascript, so I just put an enclosing table around the gridview, and the TD that contains the gridview has an ID of 'easytoselect'.
    The problem is that when the email program opens, the page is not shown as it appears, instead you see html tags in the body of the email.
    Is there a way around this? I could have javascript select the contents of the TD, but I don't think I could get it to paste into
    the body of the email program.

  2. #2
    Join Date
    Jul 2008
    Location
    urbana, il
    Posts
    2,787
    the mailto: protocol only support plain email, not html email.
    in fact, there is no such official thing as HTML email.
    lots of mail readers support HTML (outlook, eudora, etc), but again, there is no spec that defines such activity.

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



Recent Articles