Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29758

Sending an email with HTML [duplicate]

$
0
0

I've been doing my first website with basic HTML and CSS and now I want to make a form where someone can enter their name, email and a message that will send to my email adress.

I've been trying to use PHP:

if(isset($_POST['submit'])) {
  $name = $_post['name'];
  $mailFrom = $_post['mail'];
  $message = $_post['message'];

  $mailTo = "olaus97@hotmail.com";
  $headers = "From: " . $mailFrom;
  $txt = "Du har fått mail från ".$name.".\n\n".$message;


  mail( $mailTo, $subject, $txt, $headers);
  header("Location: index.php?mailsend");
}

My files are named index.html and send_form_email.php. My problem is that I can't get it to connect with my HTML document (using Apache for localhost).


Viewing all articles
Browse latest Browse all 29758

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>