email sender in php

Lightbulb demo page.

support page 

if we look on the code here you can also see this handel errors 
$to = $_POST['temail'];
echo("enter the correct email");}
$from = $_POST['femail'];
echo("enter the correct email");}

handel error

sender name 

<form action="email.php" method="post">

you can rename email.php to something you want            also rename the email.php to your file name! in the code!

<!doctype html>
$to = $_POST['temail'];
if(!filter_var($to, FILTER_VALIDATE_EMAIL)){
echo("enter the correct email");}
$from = $_POST['femail'];
if(!filter_var($from, FILTER_VALIDATE_EMAIL)){
echo("enter the correct email");}
else {
$fname = $_POST['fname'];
$lname = $_POST['lname'];
$message = $fname."".$lname."\n".$_POST['message'];
$message = wordwrap($message, 70);
$headers = "From:" . $from;
$subject = "form submission";
mail($to , $subject, $message, $headers);
echo("mail send");
<meta charset="utf-8">
<title>Untitled Document</title>

<form action="email.php" method="post">
<table align="center">
<td><input type="text" name="fname" placeholder="first name">
<input type="text" name="lname" placeholder="last name"></td>
<td><input type ="email" name="temail" placeholder=""></td<-- if we look here we can see this show
</tr><br><br>                                                                                                                     as none text look on in the page on in the top url
<td><input type="email" name="femail" placeholder=""></td></tr>
<td><textarea cols="40" rows="5" placeholder="Enter your useful message here" name="message"></textarea></td></tr>
<tr><td></td><td><input type="submit" name="submit" value="send"></td>

you can also download the file!

Attached Files
.php   contact-us.php (Size: 1.32 KB / Downloads: 2)

Users browsing this thread:
1 Guest(s)