PDA

View Full Version : Stupid mistake with mail()


Lea Verou
06-28-2006, 02:31 PM
This has nothing to do with vbulletin but another site.

I have a mail form that the user completes and sends. Then supposedly I should receive an email with the content of that form. I have used this code which takes the form data, forms and sends the mail and then redirects the user with a meta tag, after 5 seconds. This is the php code and after it is just the html code of the page, which I see no reason to quote:

<?php
$mail = 'michelle@e-steki.com';
$mailmessage = 'You have been sent the following message from the Michaelia Hotel Contact form:
----------------------------------------------------------------------------------------
Name: ' . $_POST['fname'] . ' ' . $_POST['lname'] . '
Email: ' . $_POST['mail'] . '
Phone numbers: ' . $_POST['phone1'] . ', ' . $_POST['phone2'] . '
Address: ' . $_POST['address'] . '
Room type: ' . $_POST['roomtype'] . '
From' . $_POST['fromdate'] . ' to ' . $_POST['todate'] . '
Number of rooms: ' . $_POST['roomnum'] . '
Comments: ' . $_POST['message'];

mail($mail,'New message from Micheaelia Hotel contact form',$mailmessage);
?>

I have probably made a very stupid mistake which I can't figure out cause I receive absolutely NO such email...
Any ideas?

PS: The site is hotel.mycat.gr (the domain is temporary till I finish the site). It's for my mother's small hotel. I would also appereciate your opinion on the design, but I care more about solving the problem now, so I did not put the thread in site commenting. :)

Any help is greatly appereciated.

sabret00the
06-29-2006, 08:14 PM
is it giving an error at all?

mail($userinfo['email'],"Reply To Journal Comment", $messagebody, "From: \"" . $sitetitle . " Mailer\" <" . $webmasteremail . ">");

however if you're not getting any error message at all, it's probable that you just haven't configured SMTP on your server.

Lea Verou
06-29-2006, 09:53 PM
No error at all.
I'm sure the SMTP server is configured cause another site of mine on the same server sends the mail fine. :(

sabret00the
06-29-2006, 10:54 PM
have you tried substituting the $messagebody with something else for testing purposes?