I recently added a contact page to my site, where a user can send an email to me if they have a query.
I used the https://www.bitdegree.org/learn/php-mail-function example, and it displays correctly on the page, but does not send the email. It simply takes me to the 000webhost home page.
Have I done something wrong?
or better yet - does anyone know of any good scripts to use?
Thanks for that. I did find another script, and it is working perfectly.
Thanks for responding
Michael, I have the same trouble. Can you tellme what is the another scrip what you find??
Thanks a lot.
I’m about to remove mine, due to spam. My script does not have an adequate spam detection function.
Try using the one sizzlefire mentioned.
Sorry I can’t help.
Quarker
September 13, 2009, 4:09pm
#8
Hi
I want to use contact form, but don’t send the message. [COLOR=“Red”]Why? [/COLOR]
The script:
<?php
$Name = $_POST[‘Name’];
$Email = $_POST[‘Email’];
$Comment = $_POST[‘Comment’];
$To="MYMAIL@gmail.com ";
$Subject=“Contact form, Your Website”;
$Answer=$_POST[‘Answer’];
$Yanswer=$_POST[‘Yanswer’];
$Message=“
From: $Name
Email: $Email
$Comment”;
if ($Answer==$Yanswer){
mail($To,$Subject,$Message);
include (‘contact.html’);}
else{
include (‘error.html’);
}
?>
Validation code:
<?php>
$A= rand(1, 9);
$B= rand(1, 9);
$C=$A+$B;
?>
Edit:
[COLOR=“Red”]This script working perfectly on another free website provider!!![/COLOR]
What is wrong on 000webhost???
Quarker
September 13, 2009, 7:50pm
#9
I tried an other contact form (www.freecontactform.com ), but this does not send mail.
The letter sending is successful apparently.
:mad:
Here is a PHP form mail script:
PHP Form Mail Script.
Quarker
September 16, 2009, 12:44pm
#11
Thanks, i will try later!
Quarker
September 16, 2009, 4:06pm
#13
Don’t work… :mad:
There is some fatal mistake in the server.
I have to look for an other free web hosting provider.
Quarker
September 16, 2009, 4:10pm
#14
Working for somebody the contact form on this server?
Ransom
September 18, 2009, 1:21pm
#15
I have the same problem with the php mail function. I have 2 accounts on this host and the one with my domain is not sending mails. The other one works perfectly.
I can’t be blocked for spam because it’s not a huge site to send many e-mails, and i didn’t send mass mails.
Where can be the problem?
I tested the mail function with the simplest php code:
<?php
$to = "my_other_email@example.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "my_email@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
if (mail($to,$subject,$message,$headers)) echo "Mail Sent.";
else echo "Not sent";
?>
Here try this contact form out it might work:
<html>
<body>
<form action="MAILTO:YOUR@EMAIL.COM" method="post" enctype="text/plain">
<h3>Contact Form.</h3>
Name:<br>
<input type="text" name="name"
value="yourname" size="20">
<br>
Mail:<br>
<input type="text" name="mail"
value="yourmail" size="20">
<br>
Comment:<br>
<input type="text" name="comment"
value="yourcomment" size="40">
<br><br>
<input type="submit" value="Send">
<input type="reset" value="Reset">
</form>
</body>
</html>
Ransom
September 18, 2009, 2:52pm
#17
thanks, but i have problems with the mail function.
the script you posted is good, but without a captcha your mailbox would be full of spam in a minute…:))
Quarker
September 18, 2009, 3:18pm
#18
Use this captcha:
http://image.captchas.net?client=demo&random=RandomZufall
(it’s an image link but i think it changes still)
Ransom
September 18, 2009, 3:28pm
#20
I’ve sent a ticket, so no need to send more.
yes, i’m on the same server (server37.000webhost.com ). they said, they will check the server settings.