0

So, I've created a contact form to my page by following w3school's Contact Form -tutorial (https://www.w3schools.com/howto/howto_css_contact_form.asp).

Now, I have the contact form looking pretty and nice and just how I want it to look like, but how the frick do I get the form to send me e-mail? That's the point of the contact form but there's no tutorial for that on w3schools -site.

And I want the page to say something like "Thank for your message" after the user has clicked the "send"-button on my form. If there's a easy and quick way to do that... But most importantly, I want to get the messages delivered to my e-mail.

Could someone help a beginner?

cinnacode
  • 17
  • 1
  • 4
  • You can go through youtube tutorials based on email with asp. W3 schools just gave you the html coding. – Chandra Shekhar Dec 19 '18 at 04:15
  • Alright, so I watched a few tutorials about the topic. Do I really have to have my website actually on internet for to test out if the php-file works? Because on the tutorials that I watched, there's always a part where you have to link your website in to the php-file "$email_from = 'insert website address here';" – cinnacode Dec 19 '18 at 05:15
  • sign up for a free hosting service and try it out. because as of my knowledge you cannot send a mail from localhost. you need to have some mail configuration settings to proceed. – Chandra Shekhar Dec 19 '18 at 05:21
  • If you send email using php you can configuration settings into php.ini regarding SMTP. You can send email from your localhost. Refer this article https://stackoverflow.com/questions/19132171/send-email-from-localhost-running-xammp-in-php-using-gmail-mail-server – Dipti Dec 19 '18 at 05:35

1 Answers1

-1

Don't know if this is what you're looking for, but W3Schools has a tutorial on email submissions here: https://www.w3schools.com/html/tryit.asp?filename=tryhtml_form_mail

As for the "Thanks for your message" note, I'd suggest some JavaScript:

<form>
(content)
<input type="submit" onclick="message()">
</form>
<div id="thanks"></div>
<script>
function message() {
document.getElementById("thanks").innerHTML = "Thanks for your message!";
}
</script>

Hope this helps!