---
title: "How can we send mail using JavaScript?"  
description: "How can we send mail using JavaScript?"  
author: "Anonymous User"  
published: 2011-03-18  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/478/how-can-we-send-mail-using-javascript  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# How can we send mail using JavaScript?

No. There is no way to send emails directly using JavaScript. \
\
But you can use JavaScript to execute a client side email program send the email using the "mailto" code. Here is an example: \
\

```
function functioname(form)
{
tdata=document.myform.tbox1.value;
location="mailto:emailid@domain.com?subject=...";
return true;
}
```

## Answers

### Answer by Anonymous User

No. There is no way to send emails directly using JavaScript. \
\
But you can use JavaScript to execute a client side email program send the email using the "mailto" code. Here is an example: \
\

```
function functioname(form)
{
tdata=document.myform.tbox1.value;
location="mailto:emailid@domain.com?subject=...";
return true;
}
```


---

Original Source: https://www.mindstick.com/interview/478/how-can-we-send-mail-using-javascript

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
