Created
June 11, 2021 06:20
-
-
Save carloslenondavis/5a76c51217f1a513f2d1d1220ba6e91d to your computer and use it in GitHub Desktop.
Implementation for SMPT.JS to send email with js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<title>repl.it</title> | |
<link href="style.css" rel="stylesheet" type="text/css" /> | |
</head> | |
<body> | |
<button onclick="SendMailTo()">Send Email</button> | |
<script src="https://smtpjs.com/v3/smtp.js"></script> | |
<script src="script.js"></script> | |
</body> | |
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function SendMailTo() { | |
Email.send({ | |
Host: "smtp.elasticemail.com", | |
Username: "[email protected]", | |
Password: "0E6ADCFB0D49022EB1BAB157BD25EB0FA4A5", | |
To: '[email protected]', | |
From: "[email protected]", | |
Subject: "This is the subject", | |
Body: "And this is the body", | |
Attachments: [ | |
{ | |
name: "smtpjs.png", | |
path: "https://networkprogramming.files.wordpress.com/2017/11/smtpjs.png" | |
}], | |
}).then(message => console.log(message)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment