Send button dont work - html

I have a code and it doesn't send email. Who can help me to make correct change? The button doesn't work. This is my code.
<form id="contact" action="mailto:suport#radioryzer.ro" method="post">
<center><h3>Formular de contact</h3></center>
<fieldset>
<input placeholder="Nume si Prenume" type="text" tabindex="1" required autofocus>
</fieldset>
<fieldset>
<input placeholder="Email" type="email" tabindex="2" required>
</fieldset>
<fieldset>
<input placeholder="Website (optional)" type="url" tabindex="4"
</fieldset>
<fieldset>
<textarea placeholder="Mesaj" tabindex="5" required></textarea>
</fieldset>
<fieldset>
<button name="submit" type="submit" value="Send Email" id="contact-submit" data-submit="Se trimite...">Trimite</button>
</fieldset>
</form>

Using a mailto to send an email via a form isn't a very reliable way to do mail sends. When it does work, it should open up the user's default mail client (if they have one installed) and compose a new email that the user will have to then send themselves. There are limitations of what you can pass along to the mail client - really just an subject and a body. If you want to format the body content, you may need to write some fancy javascript to handle that. If the user does not have a mail client, this would not work.
In addition, the support of this is browser specific. In my testing Safari did not work while Google Chrome did.
My recommended approach here is to set your action to a path on your server and handle the email sending server side. This would give you more control of how you want your messages formatted when it goes to your desired address and in addition, work more reliably since this is universally supported amongst clients ensuring a better user experience for your visitors.
If you still want to go with the mailto approach, this may help you out - How to send an email using only HTML5 and CSS

Related

HTTPS for mailto: in html

I would like for my page to have the green padlock signifying that it is secure. However, according to https://www.whynopadlock.com/ I need to change my mailto: form.
Here is my current HTML code:
<form action="mailto:myemail#gmail.com" enctype="text/plain" method="post">
<input type="text" name="name" placeholder="Name" class="name" required />
<input type="email" name="emailaddress" placeholder="Email" class="email" type="email" required />
<textarea type="text" rows="4" name="Message" placeholder="Message" class="message" required></textarea>
<button class="res" type="reset" value="Reset">Reset</button>
<input name="submit" class="butn" type="submit" value="ยป" />
</form>
How can I change this code to make my site more secure?
However, according to https://www.whynopadlock.com/ I need to change my mailto: form.
I don't see any claim regarding mailto: links at the site you reference.
And there is simply no HTTPS for mailto: links since writing a mail is done by a user specific application, which can be done a local mail client which is using SMTP for mail delivery (with or without TLS, depending on the settings of the client) or it can be done some web based mail application which might or might not be using HTTPS.
Apart from that using mail delivery to forward the data filled into a web form is probably not a good idea in the first place since it requires the user to have setup some mail application already - i.e. unusable for use with web kiosk, internet cafes etc. The common way is instead to have some backend at your site as form target, and this time you could use https://.

HTML E-mail form

So my site is almost done but I'm stuck on the part of sending an email.
Everything works, when I fill in the fields. But it always gets saved as a draft so I don't receive the email.
Here is my html code:
This code is copied from a site.
<form action="mailto:myemailadress#gmail.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name"><br>
E-mail:<br>
<input type="text" name="mail"><br>
Comment:<br>
<input type="text" name="comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
action="mailto:myemailadress#gmail.com" <-- This is not correct.
You'll have to point your post submission to a handler php file that will process the form request and submit the email.
Now, some host providers do have a php mailer to make us things easier, e.g godaddy https://www.godaddy.com/es/help/using-our-php-form-mailers-on-web-and-classic-hosting-8376 .
An example of php mail handler for forms can be found here http://www.freecontactform.com/email_form.php . It has some validation code too.
There is a possibility that you're using a server that doesn't support PHP but ASP, .NET, Node.js or some other, in that case i can't help you because i'm not familiar to none of them :)

I can't get my submit button to send an email, Ive tried several formats

I am using a form id= contact-form with a form loader. I have tried getting my email to submit with form action and html href however nothing has working this is what I am currently trying to get to work. any suggestions?
<form method="post" action="mailto:m_galvin1005#email.campbell.edu" >
<input type="submit" value="Send Email" />
</form>
I placed this form method inside of a form id. Not sure if thats where I am getting held up at
Unfortunately, browsers don't actually know how to send emails. The web browser only really knows how to render HTML, JS and CSS code into a visual experience.
PHP is a language that runs server-side, which you can use to tell a web server to send an email to whatever address you input.
Here's a good article on PHP Emailing: https://css-tricks.com/snippets/php/send-email/
It is important to note that this code REQUIRES a web-space or server to compile.
It will be a very basic email form, having said this I think you are missingpost argument in your form tag. The following should work
<form action="mailto:m_galvin1005#email.campbell.edu" method="post" enctype="text/plain" >
Name:<input type="text" name="Name">
Email:<input type="text" name="Email">
<input type="submit" name="submit" value="Submit">
</form>

How to send information submitted in html to email

I am making a website and I want one of the pages to have a form where they write their contact information and then have it sent to me when they press the submit button. I tried doing it in HTML by using this code
<form action="MAILTO:XXXXX#XXX.com" method="post" enctype="text/plain">
And then I have the form entries and a submit button. I enter some random details but it never sends me an email.
Here's my form entries if it means anything
Name:<br>
<input type="text" name="name" value="your name"><br>
E-mail:<br>
<input type="text" name="mail" value="your email"><br>
Comment:<br>
<input type="text" name="comment" value="your comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
As others stated in comments above, you're mixing up 2 things. You have 2 options going forward.
Option 1 is using a server-side language like PHP to send the e-mail. This is a bit harder to do, but it allows you to have a form on your page like you describe in your question. In this case, you'd have to change the action attribute of the <form> to the path to the (PHP) page/file that will process the POST request. Here's a tutorial on how to send e-mail in PHP.
Option 2 is to get rid of the form and replace it with a link that will boot the user to his e-mail program with the To: field already filled out. Obviously, this will only work if the user has a local e-mail program set up. It's usually not compatible with webmail (like Gmail, Outlook.com...). However, it can be implemented in a single line of code:
Should you opt for option 2, you can just replace the <form> element with the following code snippet, which will produce the link:
your-address#example.com
Note that in the snippet above, I repeated the e-mail address as the text of the <a> tag. This ensures that people who use webmail can copy-paste the e-mail address in the web app.

Does HTML MailTo actually send the e-mail? If so how?

So my question is when we use the following code:
<!DOCTYPE html>
<html>
<body>
<h3>Send e-mail to someone#example.com:</h3>
<form action="MAILTO:someone#example.com" method="post" enctype="text/plain">
Name:<br>
<input type="text" name="name" value="your name"><br>
E-mail:<br>
<input type="text" name="mail" value="your email"><br>
Comment:<br>
<input type="text" name="comment" value="your comment" size="50"><br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
What I'm asking is:
does this actually send an email to someone#example.com? if so how?
No, the browser fetches the default mail client. It does not automatically send the e-mail, it simply shorthands the process of opening the mail client and putting certain values such as addresses in the header.
No the browser is not capable of sending email. Usually a server side language, like PHP or JAVA is used to send the email. You can find scripts where you can send the data to and it will send an email for you.
Sending an email is a complicated task requiring ports to be open and certain headers to be sent with the message describing the To, From, Subject, Body, and more fields.
mailto is a browser shortcut to enable links to be opened in the default client, that the user chooses.
Here's how you can send email using a PHP Script. If you do not have php on your server then you can not use this.
If you want to create an email template the mailto supports a few more parameters that can be passed along. Here's an example. If you use javascript you can have the user fill in the form, then when they click submit have it open an email, in their default client (including web emails), and have it prefilled for them to click send.