PHP contact form not working?

Status
Not open for further replies.

enricosa

New Member
Messages
11
Reaction score
0
Points
0
Hi i registered as a free account and i have made my website. All works perfectly but my PHP Contact form gives me the server 404 error page when ever i click the submit button... Does the free server not support PHP mail sending? Please help.

Thanks
 

shubhami

New Member
Messages
10
Reaction score
0
Points
0
check the syntax. Maybe you have not put this action file for example -
<form action = "send.php" method = "post" >
<!--you code-->
</form>
 
Last edited:

enricosa

New Member
Messages
11
Reaction score
0
Points
0
This is the code i used for the PHP file:

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$call = $_POST['call'];
$website = $_POST['website'];
$priority = $_POST['priority'];
$type = $_POST['type'];
$message = $_POST['message'];
$formcontent=" From: $name \n Phone: $phone \n Call Back: $call \n Website: $website \n Priority: $priority \n Type: $type \n Message: $message";
$recipient = "chicken-dip@gmail.com";
$subject = "Contact Form";
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You for contacting me!" . " -" . "<a href='contact.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>

and this is the code on the actual HTML page:

<div class="form">
<div id="stylized" class="myform">
<form id="form1" action="mail.php" method="POST">
<label>Name
<span class="small">Add your name</span>
</label>
<input type="text" name="name">
<label>Email
<span class="small">Enter a Valid Email</span>
</label>
<input type="text" name="email">
<br />
<br />
<br />
<br />
<label>Message
<span class="small">Type Your Message</span>
</label>
<textarea name="message" rows="6" cols="25"></textarea><br />

<button type="submit" value="Send" style="margin-top:15px;">Submit</button>
<div class="spacer"></div>

</form>

How i managed to get it working but, i am not recieving any emails... i have done about 6 or 7 different tries but none of them reach me... please help

---------- Post added at 05:14 PM ---------- Previous post was at 01:14 PM ----------

anyone? i don't receive any emails and this is the last part... please?
 

descalzo

Grim Squeaker
Community Support
Messages
9,373
Reaction score
326
Points
83
$mailheader = "From: $email \r\n";

Problem: The From MUST be from an account on your site, not a visitor's email.
 

enricosa

New Member
Messages
11
Reaction score
0
Points
0
To: descalzo

im sorry i did not understand what you meant... im pretty noob at coding and all so could u please show me how the code will look like?
 

enricosa

New Member
Messages
11
Reaction score
0
Points
0
To: descalzo

Sorry man, im probably doing something wrong, this is my code:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$call = $_POST['call'];
$website = $_POST['website'];
$priority = $_POST['priority'];
$type = $_POST['type'];
$message = $_POST['message'];
$formcontent=" From: $name \n Phone: $phone \n Call Back: $call \n Website: $website \n Priority: $priority \n Type: $type \n Message: $message";
$recipient = "enricomattiasanti@gmail.com";
$subject = "Contact Form";
$mailheader = "From: enricomattiasanti@gmail.com\r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You for contacting me!" . " -" . "<a href='contact.html' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>

im seriously lost...
 
Status
Not open for further replies.
Top