Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
1.40/5 (3 votes)
See more:
Is it possible to send Mail using javascript. If yes then kindly give me some hint.
Updated 13-Jul-18 1:38am
Nitij 13-Jun-16 6:02am    
You can't. Server needs to come into picture to provide authentication details.

JavaScript is of course client based so doesn't have the capabilities as say C# on the server. To send email, without calling some server-side code, you are basically limited to mailto
Share this answer
You can see this here[^]. It uses Javascript but sends email using Outlook automation.
Share this answer
NO! JavaScript can’t email a form! but, there are alternatives to send the form data to an email address.

See detail here:[^]
Share this answer
You could create a web service that sends a mail...

public void SendEmail(string subject, string message)
     // Standard C# Send Mail stuff    

Then, you could call the web service from script to send the mail.

Have a look at jquery or other scripting frameworks which provide AJAX helper functionality for calling web service methods
Share this answer
<form method="post" action="">
    <input type="text" id="email" name="name" required>
    <input type="button" value="Send Email" onclick="send()/>

<script type="text/javascript">
  function send() {
    var link = ' from '
    window.location.href = link;
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