Reputation: 799
I'd like to open an email automatically with To & subject, when the html page loads. I need to use only mailto functionality. Can someone help me how to do this?
Upvotes: 3
Views: 5595
Reputation: 884
try something like this
<html>
<head>
<script type="text/javascript">
function mymessage()
{
location.href = "mailto:[email protected]?subject=Hello";
}
</script>
</head>
<body onload="mymessage()">
</body>
</html>
Upvotes: 2
Reputation: 324820
Redirect the user to a mailto
link. This can be done with basic JavaScript:
location.href = "mailto:[email protected]?subject=Test+Message";
Just take into consideration the fact that:
Just be careful.
Upvotes: 9