I made a form but it doesn't send to my email; instead, it opens Windows Live Mail.
Here is my code:
<form name="name" action="mailto:someone#example.com" method="post">
What can I do to make the form send to my email instead of opening Windows Live Mail?
Your code IS good. Your code does exactly what it is supposed to do. When you submit a form with action attribute involving a mailto:, it opens up your email program to send an email to the someone#example.com address.
If you want the form to not send the email using the system's default mail program, you need to use something server-side. I don't know of any client side solutions, but who knows. There might be something out there...
Related
I am developing our company website with Odoo (14) and for newsletter subscription I use Email marketing module. When you install this module, you are able to use drag and drop Newsletter block snippet. It looks really handy because you only need to choose which newsletter it will save on dashboard and that is it. It works pretty well but the only thing that I could not change is the input value. It automatically shows my email that I use for login to Odoo. When I check it in a new incognito window, it shows our mail sender email.
I have tried to give value="" to that input but it did not work. I only want to have a placeholder text: Your e-mail address but I do not know how.
Do you have any idea?
I have a script written to send an email of a completed form when I click a button but it doesn't work, here's the code:
<button type= "button" onclick= form action="mailto:Myemail#mail.co.uk">Submit</button>
where have I gone wrong? I'm aware that I don't have Outlook Express so if form action does not work without it, is there an alternative?
where have I gone wrong?
You are trying to use mailto: as a form action. It doesn't work.
You are trying to specify your action on a <button> instead of on a <form>
You are using a type="button" (which is for JavaScript binding) instead of type="submit"
is there an alternative?
Submit to a server side program, written in the language of your choice (that is supported by your server), and have it send the email. Third party hosted options are available.
If you want to open the email client on button click use this:
<input type="button" value="Submit" onClick="parent.location='Myemail#mail.co.uk';">
You do not need form action for that.
Another option is to write some kind of server side code that sends the email directly without having to open up the email client. You can write the code in variety of languages like PHP, ASP.NET etc.
I have created one html static inquiry form and i want to write a code on submit action in which when we click on submit, One email will send on my account.
How can i write a code in static html form to send email in static html page?
Only HTTP(S) URIs are safe for use in form actions. You need a server side process to send email (even if it is an externally hosted, third party service). Attempts to do this purely client side are too unreliable to use.
You can't do this with pure static HTML. You'll need to use some sort of server side scripting, via an embedded language like PHP/Python/Perl/Ruby/etc., or a CGI handoff to a custom executable.
Unfortunately you cant automatically send a email from a html/static file, you would have to use some server technology to process the request and send the email.
its not to difficult to do though, so check out this tutorial from css tricks css tricks email in php tutorial
there is also the php docs here php.net docs for mail()
((The above is for PHP, see asp.net email if you are using asp.net
(there is also node, java, python etc, but php and c#.net are all I have experience in)
There is always the option to use mailto
<a href='mailto:myemail#me.com'>send an email</a> // etc
However this will only open up the users email client, so could put some users off (as well as making it unusable for people without an email client (although it can be used to open up web based clients such as gmail)) so not ideal.
Check out the answer posted here
https://stackoverflow.com/a/34653647/1609406
tl;dr
<form action="http://formspree.io/your#email.com" method="POST">
<input type="email" name="_replyto">
<textarea name="body">
</textarea>
<input type="submit" value="Send">
</form>
How can i code a HTML (using CSS) file to send an email to me(i.e. to given email-id) by the visitor of that website?
Without using a server-side language, the best you can really do is a mailto link. That will open the user's default email editor with the "To" field populated with the value of your mailto link. You can create one of those like so:
Email Me!
It is possible to provide extra information in a mailto link, to populate more fields. For example, if you want to provide a subject:
Email Me!
You can also provide a value for the body, cc and bcc but I have no idea how well those default values are supported by various email clients.
Also note that this has absolutely nothing whatsoever to do with CSS, which is used for styling documents. I've therefore removed the CSS tag from your question.
You cannot. You can use a tag:
Email Me
And this will open a mail client in the client side. The client must have it configured for being able to send a email.
If you want to create a form that, when the user presses a button "send" sends you a message, you must use a dynamic language such as PHP.
I am working on a login dialog to my site. To spare users the frustration of having to remember their login details, I want to cooperate with the built-in browser password managers. I have worked out that to get Firefox to play ball, I must use a plain-vanilla HTML Form. Fine, so be it. However, I will not transfer unencrypted passwords. So my form content looks like so:
input#1 type="text" name="login"
input#2 type="password"
input#3 type="hidden" name="passwd"
I then intercept the submit and encrypt the content of #2 into #3, and off goes the form. Works a treat in IE and Firefox, not so in Opera and Chrome. Just rifled around SO and find that the problem is input#2, which does not have a "name" attribute. A quick test reveals that when I add name="ignore" it does work indeed in Chrome and Opera. Only trouble is that the password is now sent across the network plain text, with the label "ignore". Thanks a bunch. The whole point of omitting the "name" was to omit that field from the form.
If there a way that I can suppress input#2 from being sent while still giving it a "name"? Or is there another trick I could use?
Thanks.
The answer in the narrowest sense of the original question is: yes, it is possible via Ajax. Create a vanilla FORM with two named INPUTs and submit BUTTON. (Don't forget to feign some action in the FORM attributes.) Now it looks like a plain-text HTML affair. Next in JS, intercept the onsubmit from the FORM and launch an Ajax request to your PHP script, POSTing the plain login and hashed password. Return FALSE from onsubmit to suppress the FORM's action. You're done. No more plain-text passwords across the wire...