Here is my code, It takes input from user and sends an email as them. it was working fine, but it stopped working, does anyone know why?
function othername() {
var input = document.getElementById("userInput").value;
}
function pass() {
var password = document.getElementById("password").value;
return password;
}
function sendEmail() {
Email.send({
Host: "smtp.gmail.com",
Username: othername(),
Password: pass(),
To: 'person@gmail.com',
From: othername(),
Subject: "Sending Email using javascript",
Body: "This email was sent with javascript :)",
})
.then(function(message) {
alert("mail sent successfully")
});
};
<script src="https://smtpjs.com/v3/smtp.js"></script>
<p style="position:absolute; top:50%; left:5%; width:40%;">Put in your email address:</p>
<p style="position:absolute; top:70%; left:5%; width:40%;">Put in your password(we do not save this, read more in our about page)</p>
<form id="form" onsubmit="return false;">
<input style="position:absolute; top:60%; left:5%; width:40%;" type="text" id="userInput" placeholder="Example@gmail.com" />
<input style="position:absolute; top:80%; left:5%; width:40%;" type="text" id="password" placeholder="example: 11223344" />
<input style="position:absolute; top:90%; left:5%; width:40%;" type="submit" onclick="sendEmail()" />
</form>
Am I making some dumb mistake? I have done this in python and sometimes it doesn't send because I reached my send limit or gmail access limit, but I have not accessed it a lot. Thanks!