javascript - Launching the e-mail client from razor view -


i have asp.net mvc4 application in have view:

@{     layout = "~/views/shared/template.cshtml"; } @section logout {      <a href='@url.action("logout", "begin")' style="margin-left: 91.3%"><img src="~/content/images/images.jpg" style="width:37px; height:37px" /></a>     } <html> <head>     <script>         function mailjob(code) {             window.open('mailto:example@gmail.com');         }     </script>      </head>     <body>  <form action="/pages/index" method="post" style="margin-left:20%">     <div class ="centertitle">         <h1 style="color:rgb(73, 140, 212)">norm impact : registre des réclamations clients</h1>     </div>     <div class="noprint">          <input type="hidden" value ="1" name="pages"/>                 <button type="submit" value="submit" name="btnpage1"><img src="~/content/images/ok.png" onclick="mailjob('sample');"/></button>                 <button type="button" value="exporttopdf" onclick="window.print()" name="btnpage1"style="margin-left:55%"><img src="~/content/images/print.png" /></button>     </div>      ...      <div class="noprint">         <button type="submit" value="page2" name="btnpage1" style="margin-left:75%"><img src="~/content/images/next.png" /></button>     </div> </form>  </body></html> 

the problem in mailto because mailing soft not launching new window url mailto:example@gmail.com.

so how can fix problem?

try instead:

function mailjob(code) {     window.location.href = 'mailto:example@gmail.com'; } 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -