Triggering multiple mailto links with jquery
HTML
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
<a id="send" href="#">CLICK TO SEND</a>
<div id="links" class="hidden">
<a href="mailto:[email protected]?subject=Test subject &body=<b>this is test</b>">Mail me</a>
</div>
CSS
.hidden {
display: none;
}
JavaScript
$("#send").on("click", function(event) {
event.preventDefault();
$("#iframes").empty();
$("#links a").each(function() {
setTimeout($.proxy(function() {
var popup = window.open($(this).attr("href"))
setTimeout($.proxy(function() {
this.close();
}, popup), 100);
}, this), 100)
})
})