有没有办法发送电子邮件的数据从输入没有php或javascript只是纯简单的html? [英] is there a way to send an email with data from input without php or javascript just pure simple html?
问题描述
当点击按钮时,我想向自己发送一封不间断主题的电子邮件,如:新用户加入您的通讯,电子邮件正文中用户输入的文本。
所以用PHP和Javascript代码可能 - 我正在寻找一个完全相同的html代码(在我的index.html文件中)
使用< a href:mailto ...>
或< form action = mailto :. ..方法= post>
或< button onclick:mailto ...>
打开我的邮件应用程序:(
- 有没有办法在电子邮件正文中使用文本框中的数据在后台发送电子邮件(不打开邮件应用程序)?
- 如果是Q.1,那么是否有一种添加固定主题的方法
不,没有办法可以使用纯HTML发送电子邮件通过SMTP协议发送,浏览器以HTTP协议方式运行,因此即使使用纯JavaScript也不可能发送电子邮件,只有服务器可以使用SMTP协议。
I have HTML form with a textbox where user enter his email - let say to register for a newsletter and a button to join.
When clicking the button I'd like to send myself an email with a constant subject like: 'a new user joined your newsletter' and in the body of the email have the text entered by the user.
So with PHP and Javascript code its possible - i'm looking for a pure html code that does the same (in my index.html file)
using <a href: mailto...>
or <form action=mailto:... method=post>
or <button onclick:mailto...>
opens my mail application :(
- Is there a way to send that email in the background (without opening the mail application) with the data from textbox in the email body?
- if Yes to Q.1 then is there a way to add a fixed subject
No, there is no way you can send email using pure html. Email is sent over SMTP protocol. A browser operates in HTTP protocol. So it's not possible to send email even using pure javascript. Only server can send data using SMTP protocol.
这篇关于有没有办法发送电子邮件的数据从输入没有php或javascript只是纯简单的html?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!