有没有办法发送电子邮件的数据从输入没有php或javascript只是纯简单的html? [英] is there a way to send an email with data from input without php or javascript just pure simple html?

查看:158
本文介绍了有没有办法发送电子邮件的数据从输入没有php或javascript只是纯简单的html?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个HTML表单与一个文本框,用户输入他的电子邮件 - 让我们说注册一个通讯和一个按钮加入。



当点击按钮时,我想向自己发送一封不间断主题的电子邮件,如:新用户加入您的通讯,电子邮件正文中用户输入的文本。



所以用PHP和Javascript代码可能 - 我正在寻找一个完全相同的html代码(在我的index.html文件中)



使用< a href:mailto ...> < form action = mailto :. ..方法= post> < button onclick:mailto ...> 打开我的邮件应用程序:(


  1. 有没有办法在电子邮件正文中使用文本框中的数据在后台发送电子邮件(不打开邮件应用程序)?

  2. 如果是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 :(

  1. 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?
  2. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆