I would like to add and "email" button simular to the print button that would email the subject contents. I have tried several approaches but not having any success. Would you be willing to provide any direction?

Thanks

Forgot to add what I have done so far. I think I am close???

function mailpage(){
    var mailstring = top.document.getElementById("contentFrame").innerHTML;
        {
        mail_str = "mailto:optilinksupport@seton.org?subject=Check out the " + document.title;
        mail_str += "&body=" + mailstring //I thought you might be interested in the " + document.title;
        //mail_str += ". You can view it at, " + GetContentFrame().contentWindow.location.href; 
        location.href = mail_str;
        }
}

This thread was imported from our support forum. The original discussion may contain more detailed answer. Original topic by gnethey.

asked Apr 06 '10 at 21:32

Editor's gravatar image

Editor
46154156157


One Answer:

Get the content of an Iframe in Javascript

On this page I put this code after

...

<div class="PrintBtn" style="right: 300px;"><a href="#Email" onclick="javascript:mailpage();return false;"><img border="0" src="StaticFile.axd/Images/1.gif" id="Img1" class="IPrint" alt="Email this topic"/><em style="display: none;">Email</em></a></div>

<script>
function mailpage(){
    var myIFrame = top.document.getElementById("contentFrame");
    var mailstring = myIFrame.contentWindow.document.body.innerHTML;
        {
        mail_str = "mailto:optilinksupport@seton.org?subject=Check out the " + document.title;
        mail_str += "&body=" + mailstring //I thought you might be interested in the " + document.title;
        //mail_str += ". You can view it at, " + GetContentFrame().contentWindow.location.href;
        location.href = mail_str;
        }
}
</script>

But when i try to send a mail via Gmail i got this:

Google | Error Request-URI Too Large The requested URL /mail/... is too large to process.

Perhaps Outlook or TheBat! can help you.

answered Apr 07 '10 at 10:34

Editor's gravatar image

Editor
46154156157

Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!
toggle preview

powered by OSQA