简体   繁体   中英

Open mail client serverside with Javascript?

Is there a way to open a mail client serverside with javascript? Im using C# and ASP.Net. Web Application. Like a mailto: type functionality. Like if i clicked the button it would open up outlook on my computer with the email address wanted already inputed. Thanks

You can send a Location: mailto:some@address header. Users won't like you for doing that though; if their mail client opens unexpectedly they'll be confused/scared/annoyed.

Something of this sort:

<asp:Button runat="server" id="btn_email" Text="Send me an email"   OnClientClick="EmailClick" /> 

and script:

function EmailClick() {  
window.open("mailto:.......");  
}  

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM