使用Button包装表和发送电子邮件

时间:2018-03-10 21:52:42

标签: javascript html-table html-email

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

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

1 个答案:

答案 0 :(得分:0)

我做了一个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>

相关问题