I'm trying to send email by using Gmail SMTP. I checked so many solutions but nothing work.
Today I found this site https://www.smtpjs.com/ that may help me to solve my issue but I need help to know where should I put this HTML line:
<script src="https://smtpjs.com/v2/smtp.js"></script>
Then how can I import Email in my home.ts to use this code:
Email.send("from@you.com",
"to@them.com",
"This is a subject",
"this is the body",
"smtp.yourisp.com",
"username",
"password");
Fistly if you have button to send like that
<button id="SendMessage">SEND MAIL</button>
put the code below under the page ( i used also jquery to do it )
<script src="https://smtpjs.com/v2/smtp.js"></script>
<script>
$("#SendMessage").on("click",function(){
Email.send("from@you.com",
"to@them.com",
"This is a subject",
"this is the body",
"smtp.yourisp.com",
"username",
"password",
function done(message) { alert("This area for after mail send.") }
);
});
</script>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.