Pozdrav, pokusavao sam , gledao sam na YT al ipak nista.
Ne znam do cega je, sve normalno radi samo nece da poruka pristigne na zeljeni email ($to)
<body>
<style type="text/css">
body{width: auto;height: auto;}
@import url(http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic);
form {background: url('imgs/form-bg.png')no-repeat;width:332px;height: 335px;font-family:'PT Sans';font-size:14px;color:#242424;margin:0 auto;}
h1 {color:#ffffff;font-size:14px;font-family: 'PT Sans';font-weight: 400;text-align: center;line-height:65px;margin:0;padding:0;}
input[type=text],input[type=email]{background: url('imgs/form.png')no-repeat;width:242px;height:37px;border:none;margin-top:5px;padding-left:20px;padding-right:20px;font-family:'PT Sans';font-size: 14px;color:#242424;}
textarea{background: url('imgs/msg-bg.png')no-repeat;width:300px;height: 124px;max-height: 124px;max-width: 300px;border:none;margin-top:5px;padding:10px;font-family:'PT Sans';font-size:14px;color:#242424;}
input[type=submit]{border:none;height:39px;width:330px;font-family:'PT Sans';font-size:14px;color:#ffffff;background:#00f200;margin-top:12px;cursor:pointer;}
input[type=submit]:hover{border:none;height:39px;width:330px;font-family:'PT Sans';font-size:14px;color:#ffffff;background:#00c300;margin-top:12px;cursor:pointer;-webkit-transition: all 250ms linear;-moz-transition: all 250ms linear;-ms-transition: all 250ms linear;-o-transition: all 250ms linear;transition: all 250ms linear;}
.cont{padding-top:5px;text-align: center;}
</style>
<form action="" method="POST">
<h1>CONTACT FORM</h1>
<div class="cont">
NAME: <input type="text" name="name"><br>
EMAIL: <input type="email" name="email"><br>
<textarea name="msg"></textarea>
<input type="submit" value="Send" name="subm">
</div>
</form>
<?php
if(isset($_POST['name'])){ $name = $_POST['name']; }
if(isset($_POST['email'])){ $email = $_POST['email']; }
if(isset($_POST['msg'])){ $msg = $_POST['msg']; }
$to = "[email protected]";
$subject = "Forma |".$_POST['name']." Contact";
if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['msg'])){ die('<div class="cont">All fields must be fill.</div>');}
if(strlen($_POST['name']) <2 || strlen($_POST['name']) > 24){ die('<div class="cont">Your name isn\'t valid</div>');}
if(strlen($_POST['msg']) <2) { die('<div class="cont">Your message isn\'t valid</div>');}
if(isset($_POST['submit'])){
mail($to, $subject, $msg);
echo '<div class="cont">Message sent!</div>';
}
?>