I have a mailform using PHP but I don’t know why its not working. Could Anyone take a look see what’s wrong with my code ? Thanks<?php $to = "email@example.com"; $date = date('l dS \of F Y h:i:s A'); $msg = "Order from your site\nName: ".$_POST['name']."\nTelephone: ".$_POST['tel']."\nEmail: ".$_POST['email']."\nDetails: ".$_POST['details']."\nDate: $date"; //mail($to, "Order", $msg); $fp = fopen("mail.txt", "w"); fwrite($fp, $msg); fclose($fp); echo "code=ok"; ?>
Remove the two forward slashes.
oh yeah i forgot to leave the // out.
but It’s still not working
I think it may have to do with your email address. If I remember correctly you can not use a period when using double quotes. To use a period you have to use single quotes. As the period is used for merging strings.
thanks, it’s still not working though.
I don’t see anything wrong with the mail-sending part of your script. Check the wiki article for specifics. The stuff in your script that follows the mail() function call has nothing to do with the actual sending of email.