PDA

View Full Version : mail()


TjeerdJan
11-05-2004, 03:44 PM
is mail enabled on this hosting service?

mahangee
11-05-2004, 03:44 PM
Yes it is.

What more can I say?

crimsonmoon
11-05-2004, 08:14 PM
I can reafirm what he said by saying i use the mail() function on my site and it works great!

diagonal
12-18-2004, 06:36 PM
Not sure if itīs same topic.
Iīm trying to make a form. but doesnīt works.
http://diagonal.hostmatrix.org
anybody help

Tim
12-18-2004, 06:52 PM
You might want to check your junk email folder. Things like this often get sorted in there if you don't code it exactly right.

It would also be helpful if you would post the code.

Tim :)

mck9235
12-18-2004, 07:10 PM
What is the mail() function? Does it send mail or something? (it seems obvious but no im not kidding :P)

shwaza
12-18-2004, 07:17 PM
Originally posted by mck9235@Dec 18 2004, 05:10 PM
What is the mail() function? Does it send mail or something? (it seems obvious but no im not kidding :P)
18533


I cant even come close to calling myself an expert at this, but im pretty sure that its a php function that just basically sends email, either if its a mailing list, submitting a form by email etc.

diagonal
12-18-2004, 08:51 PM
Originally posted by Tim@Dec 18 2004, 07:52 PM
You might want to check your junk email folder. Things like this often get sorted in there if you don't code it exactly right.

It would also be helpful if you would post the code.

Tim :)
18526


Hey Tim hereīs my code

<form action="mail.php" method="post">
Your Name: <input type="text" name="name">

E-mail: <input type="text" name = "email">


Comments

<textarea name="comments"></textarea>


<input type="submit" value="Submit">
</form>

<?
$name=$_POST['name'];
$email=$_POST['email'];
$comments=$_POST['comments'];
$to="abovino5@hotmail.com";
$message="$name just filled in your comments form. They said:\n$comments\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thanks for your comments.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>

hope can fix

mahangee
12-18-2004, 09:07 PM
I just copy and pasted that code to my site and tried it and it worked perfectly. I think I sent you a message or 2. :D

diagonal
12-18-2004, 09:19 PM
I must be confused. This script sends every message to my email address , doesnīt?

If the code is wright, what can i do to fix my problem?
maybe i had wrong configuration... :(

mahangee
12-18-2004, 09:23 PM
Well it sent the mail to my address okay after I changed it. :D I recommend doing what Tim said eg looking in Spam folder or turning off spamguard (or adding it too your whitelist).

diagonal
12-18-2004, 09:28 PM
Hey I tried with the same email adress of my hostmatrix acount.
It works !! :)
better later than never