There are situations mail id from a text box needs to be populated in the outlook or any other mail client by calling mailto:
Here is the one way to do it.
<html>
<head>
<script>
function sendMail(){
var mailToId = document.forms[0].mailId.value;
var mailto_link = 'mailto:'+mailToId;
win = window.open(mailto_link,'tempWindow');
if (win && win.open &&!win.closed) win.close();
}
</script>
<head>
<body>
<form name= "mailForm" >
<input type = "text" value="< Mail Id >" name="mailId">
<input type = "button" value="Send Mail "onclick= "sendMail()" >
</form>
</body>
</html>
Here is the link which talks about mailto syntax : http://www.ianr.unl.edu/internet/mailto.html
Here is the one way to do it.
<html>
<head>
<script>
function sendMail(){
var mailToId = document.forms[0].mailId.value;
var mailto_link = 'mailto:'+mailToId;
win = window.open(mailto_link,'tempWindow');
if (win && win.open &&!win.closed) win.close();
}
</script>
<head>
<body>
<form name= "mailForm" >
<input type = "text" value="< Mail Id >" name="mailId">
<input type = "button" value="Send Mail "onclick= "sendMail()" >
</form>
</body>
</html>
Here is the link which talks about mailto syntax : http://www.ianr.unl.edu/internet/mailto.html
Blogged with Flock
Comments