如何在不使用JavaScript的情况下从输入框发送邮件

huangapple go评论52阅读模式
英文:

How to send a mail from input box without JavaScript

问题

我正在创建一个网站,我在后端方面还是个新手。所以我只是使用HTML和CSS来制作我的网站。我正在创建一个包含表单的联系部分,使用输入框,不知道是否有办法让用户输入详细信息并提交表单时,内容可以发送到我的邮箱,而不使用JavaScript或其他后端技术?

我考虑过使用"mailto",但不确定它如何工作。如果有其他方法,请告诉我。谢谢。

英文:

I am creating a website and I am still a novice in Backend. So I am making my site using HTML and CSS only. I was making a contact section with a form using input boxes and was wondering if there was a way that when a user enters details and submit the form, the content gets sent to my mail without the use of Javascript or any other backend?

I thought of using mailto, but I am unsure how that would work. If there is any other way, do let me know. Thank you

答案1

得分: 1

你不能在没有 JavaScript 的情况下发送电子邮件,但你可以在没有后端的情况下(不要认为 JS 必然意味着后端)使用第三方库如 emailJS 来实现。由于你的问题中没有代码,我将告诉你如何使用 emailJS 发送电子邮件的步骤:

  1. 在 emailjs 上创建帐户,它有免费套餐。
  2. 在他们的网站上创建你的模板,并复制模板 ID 和用户 ID,然后将其放入你的代码中。
    你可以在这里找到所有文档,它们有非常好的文档:
    https://www.emailjs.com/docs/tutorial/overview/
英文:

you can not send email without javascript, but you can do it without backend(do not think that JS necessarily means backend) using third party libraries like emailJS, there is no code in your question so I will just tell you the steps of how to send email using emailJS:

  1. create account on emailjs, it has free package.
  2. you have make your template in their website and copy template ID and user ID and put it inside of your code.
    you can see all the docs here, they have pretty good docs
    https://www.emailjs.com/docs/tutorial/overview/

huangapple
  • 本文由 发表于 2023年3月7日 18:28:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/75660771.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定