How to send mail at the front end
This article mainly introduces the front-end how to send mail, the article is very detailed, has a certain reference value, interested friends must read it!
Pure front-end implementation of sending e-mail function-formspree I want to achieve the function of sending e-mail but do not know the background, I was worried about how to write this function, and then found a good thing formspree.
Send email through the formspree front end.
Need to register an account, choose free free version, new form can set up a secure domain name, and so on.
The front-end implementation sends email and js code.
1. Walk the form
Youremail:
Yourmessage:
Send
2.ajax
$.ajax ({
Type: "post", / / post request is required
Change to the email address you want to receive
Async:true
Data:values
DataType: "json"
Success:res= > {
Alert ('submit successfully, please wait patiently'); / / Operation after successful delivery
}
Error:res= > {
Alert ("unknown error, failed to send, please try again later.")
}
})
The above is all the contents of the article "how to send email at the front end". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!