Click here to Skip to main content
15,886,806 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can we send email by java script.
Posted

Javascript can't send email directly (for security reasons, or every page you visited would send itself an email to get your email address), but you can either open the users mail client:
JavaScript
window.open('mailto:WebMaster@MySite.com');
Or you can use a button to send the mail from your email host on the server via the codebehind.
 
Share this answer
 
Comments
OriginalGriff 7-Jun-12 5:16am    
Read the answer.
Mas11 7-Jun-12 5:24am    
Ok i got it..
hi,

for sending email you require SMTP server configured on your side.
Javascript is execute at client side so there is no direct way to send an email using JavaScript but the alternate solution can be.

1) you can use ajax call that will send email regarding data to your server side page and that will page will send an email.

2)Or you can develop a web service for sending email that can be invoke via your javascript(ajax) code
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900