I find nice template in html5 but i need help - how to send email from server to my email address?
<div class="title">
<h2>HTML5 AND CSS3 USE FLAT CONTACT FORM WITH TRANSPARENT EFFECT</h2>
</div>
<div class="container" id="my_view">
<p>Contact</p>
<div class="stripe"></div>
<div class="animated">
<form action="" method="post">
<div class="top-two">
<input type="text" placeholder="Name"/>
<input type="text" placeholder="Email"/>
</div>
<div class="sub-one">
<input type="text" placeholder="Subject"/>
<textarea placeholder="Message"></textarea>
</div>
<div class="btn-s">
<input type="submit" value="SEND"/>
</div>
</form>
The designer don't make php file and i don't know how to write to this. Please help me http://www.arrayform.com/2017/02/17/standard-business-contact-form-template/
You'll need a server-side language to generate an email. If you're using PHP, then your code might look like the following:
<?php
ob_start();
$to = "sagar@sunitainfosys.com";
$name = $_REQUEST['name'];
$subject = $_REQUEST['subject'];
$email = $_REQUEST['email'];
$message = $_REQUEST['message'];
echo $headers = "From:" . "info@sunitainfosys.com";
echo $email_body = "Hi,
Your Inquiry Information
My name is $name
E-mail :- $email
Subject :- $subject
Message :-
$message ";
if(mail($to,$subject,$email_body,$headers) or mysql_error()) {
?>
<script language="javascript" type="text/javascript">
<!-- alert('Your Message Sent Successfully'); -->
window.location = 'Youpage.php';
</script>
<?php
}
else {
?>
<script language="javascript" type="text/javascript">
<!-- alert('Your Message Not Sent Successfully'); -->
window.location = 'Youpage.php';
</script>
<?php
}
?>
And now you need to give a name
to each element in the HTML, like:
<input type="text" placeholder="Name" name="name" />
<input type="text" placeholder="Email" name="email" />
<input type="text" placeholder="Subject" name="subject" />
<textarea placeholder="Message" name="message"></textarea>
Please let me know if you have any concerns.