I've tried that and changed it to my email but it still isn't coming into my inbox.
My Yahoo Email and it isn't in the Spam.
Also, how can I make the email part and main content part optional?
I want them to have the choice to leave it blank and the main part and still submit not them having to put something in.
If its so hard to get it to send to a email is it possible for it to be sent to a file on the server?
PM And I Will Sort It
Page called contact.html or whatever you want
send.phpHTML Code:<html> <head> <title>I WANA SEND UR FORMZ.</title> </head> <body> <form action="send.php" method="POST"> Name:<br> <input type="text" name="name"><br><br> Message:<br> <textarea name="message">MESSAGE HERE</textarea><br><br> <input type="submit" value="Send Message"> </form> </body> </html>
PHP Code:<?php
$name = $_POST["name"];
$message = $_POST["message"];
$write = fopen("formsubmissions.php", "a");
fwrite($write, "Name<br>$name<br><br>Message<br>$message<br><br>");
fclose($write);
echo('All done fnx');
?>
When I click send I get this...Page called contact.html or whatever you want
send.phpHTML Code:<html> <head> <title>I WANA SEND UR FORMZ.</title> </head> <body> <form action="send.php" method="POST"> Name:<br> <input type="text" name="name"><br><br> Message:<br> <textarea name="message">MESSAGE HERE</textarea><br><br> <input type="submit" value="Send Message"> </form> </body> </html>
PHP Code:<?php
$name = $_POST["name"];
$message = $_POST["message"];
$write = fopen("formsubmissions.php", "a");
fwrite($write, "Name<br>$name<br><br>Message<br>$message<br><br>");
fclose($write);
echo('All done fnx');
?>
PHP Code:$name
Message
$message
"); fclose($write); echo('All done fnx'); ?>
Try this, will send to e-mail:
PHP Code:<?php
$to_email = "[email protected]"; // this is the e-mail address the message will be sent to.
$subject_prefix = "Contact"; // Example: Will be [Contact] {name}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
<title>Send Message</title>
<style type="text/css">
body {
font-size: 14px;
font-family: Arial;
}
</style>
</head>
<body>
<?php
if($_GET["action"] == "send") {
$name = $_POST["name"];
$message = $_POST["message"];
if(empty($name) || empty($message)) {
?>
<fieldset>
<legend>ERROR</legend>
<p>
Both fields are required.
</p>
</fieldset>
<br /><br />
<?php
} else {
$message = nl2br($message); // turns textarea linebreaks into HTML pagebreaks.
$subject = "[{$subject_prefix}] {$name}"; // generates subject.
mail($to_email, $subject, $message); // sends the e-mail.
?>
<fieldset>
<legend>Sent</legend>
<p>
Your e-mail was sent successfully, thank you.
</p>
</fieldset>
<br /><br />
<?php
}
}
?>
<form name="send_data" method="post" action="?action=send">
<fieldset>
<legend>Send Data</legend>
<table>
<tr>
<td><label for="name"><strong>Name:</strong></label></td>
<td><input type="text" name="name" /></td>
</tr>
<tr>
<td><label for="data"><strong>Message:</strong></label></td>
<td><textarea cols="50" rows="5" name="message"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" value="Send" /></td>
</tr>
</table>
</fieldset>
</form>
</body>
</html>
Want to hide these adverts? Register an account for free!