# Send Mail same  javascript elasticemail (ok)

<figure><img src="https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LYjAG13rAPdbArSfRyB%2Fuploads%2FOfHq34hWZajJEz8QHHFg%2Fimage.png?alt=media&#x26;token=01f5736e-8ea6-4242-b693-141656967ad3" alt=""><figcaption></figcaption></figure>

![](https://2494213435-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-LYjAG13rAPdbArSfRyB%2Fuploads%2FO2LKXw24GvhNcRS26MAB%2Fimage.png?alt=media\&token=28546587-3569-4b2c-b345-c48ef9ccc712)

```
<!DOCTYPE html>
<html>
<head>
<title>Send Mail</title>
<script src=
	"https://smtpjs.com/v3/smtp.js">
</script>

<script type="text/javascript">
	function sendEmail() {
	Email.send({
		Host: "smtp.elasticemail.com",
		Username: "phamngoctuong1805@gmail.com",
		Password: "6D2D08358926B924921F9A544DC4934BE9EC",
		To: 'phamkyanh8668@gmail.com',
		From: "phamngoctuong1805@gmail.com",
		Subject: "Sending Email using javascript",
		Body: "Well that was easy 1!!",
	})
		.then(function (message) {
		console.log(message);
		});
	}
</script>
</head>

<body>
<form method="post">
	<input type="button" value="Send Email"
		onclick="sendEmail()" />
</form>
</body>
</html>

```
