Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
400 views
in Technique[技术] by (71.8m points)

is there a way to send an email with data from input without php or javascript just pure simple html?

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
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...