Thursday, March 23, 2023
HomeGolangSending out mail with go api - Obtaining Assistance

Sending out mail with go api – Obtaining Assistance


i have javascript codes i intend to send out mail with go gin structure do you have any type of concept just how i can do this

index.html

<.
<< html lang=" en">
<> < head>>.
<< meta charset=" UTF-8">
<> < meta http-equiv=" X-UA-Compatible" web content=" IE= side">
<> < meta name=" viewport" web content=" size= device-width, initial-scale= 1.0">>.
<< web link rel=" stylesheet" href=" https://forum.golangbridge.org/t/sending-mail-with-go-api/style.css">

<> .
<< body>>.
<< div id=" overlay">
<> < kind onsubmit=" event.preventDefault(); validateForm()">>.
<< h1>> Get in touch with United States<.
<< tag for=" name"> > Name:<.
<< input kind=" message" id=" name" placeholder=" Your name">>.
<< little course=" mistake"><>  < tag for=" e-mail"> > Email: <.
<< input kind=" message" id=" e-mail" placeholder=" Your e-mail">>.
<< little course=" mistake"><>  < tag for=" message">> Message:< < textarea id=" message" placeholder=" Your message" rows=" 6"><>  < little course=" mistake"><>  < div course=" facility">
<> < input kind=" send" worth=" Send out Message">>.
<< p id=" success"><>  .


<.
<.

<< manuscript src=" script.js"><>  .
<.

script.js

 const nameInput = document.querySelector(" #name");.
const e-mail = document.querySelector(" #email");.
const message = document.querySelector(" #message");.
const success = document.querySelector(" #success");.
const errorNodes = document.querySelectorAll(". mistake");.
// Validate information.
feature validateForm() {

clearMessages();.
allow errorFlang= incorrect;.

if (nameInput.value.length < < 1) {
errorNodes[0] innerText="lütfen adınızı girirniz";.
nameInput.classList.add(" error-border");.
errorFlang= real;.
}
if (! emailIsValid( email.value)) {
errorNodes[1] innerText="lütfen mail adresi giriniz";.
nameInput.classList.add(" error-border");.
errorFlang= real;.
}

if (message.value.length < < 1) {
errorNodes[2] innerText="lütfen mesajınızı giriniz";.
message.classList.add(" error-border");.
errorFlang= real;.
}
if (! errorFlag) {
success.innerText=" başarılı";
}
}
// Clear mistake/ success messages.
feature clearMessages() {
for (allow i = 0; i < < errorNodes.length; i++) {
errorNodes[i] innerText="";.
}
success.innerText="";
nameInput.classList.remove(" error-border");.
email.classList.remove(" error-border");.
message.classList.remove(" error-border");.
}

// Examine if e-mail stands.
feature emailIsValid( e-mail) {
allow pattern =/ S+@S+.S+/;.
return pattern.test( e-mail);.
}


I believes this write-up might be usefult, https://blog.loginradius.com/engineering/sending-emails-with-golang/

Develop a STMPClient item utilizing the NewSMTPClient feature. ...
Develop a brand-new e-mail message with NewMSG. ...
Afterwards, you require to get in touch with the SMTP web server with web server. ...
When attached, simply send out the e-mail (or all the e-mails you desire) utilizing the feature e-mail.
Much more information to go my internet site

https://frencoltd.com/seo-consultant-services/.

RELATED ARTICLES

Most Popular

Recent Comments