包装 Table 并使用按钮发送电子邮件

Wrap Table and sent e-mail with a Button

可以使用一个 JavaScript 函数和一个按钮发送电子邮件到已经打印好的 html table ?

<table id="mytable">
</table>

我做了一个 PHP 函数,我调用了我需要发送结果的所有软件。

来电

<?php SendEmailForm("MyIdElementToSend"); ?>

和函数

function SendEmailForm ($MyIdElementToSend){
?>
<form id="EMailForm" action="SendMail.php?SendMail=true" method="post">
    <div class="form-group">
        <div class="row">
            <div class="hide">
                <input id="msg" type="text" class="form-control" name="msg" value="" />
            </div>
            <div>
                <button id="sub" type="submit" class="btn btn-primary"><i class="fa fa-envelope" aria-hidden="true"></i> Send</button>
            </div>
        </div>
    </div>
</form>
<script>
    document.getElementById("msg").value = document.getElementById("<?php echo $MyIdElementToSend ?>").outerHTML;
</script>