PHP mailform

PHP mailform

Posted by: bluestorm909
Posted on: 2006-07-12 15:01:00

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 = "billing@bluestorm909.com";
$date = date('l dS of F Y h:i:s A');
$msg = "Order from your sitenName: ".$_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";
?>

Re: PHP mailform

Posted by: scjessey
Posted on: 2006-07-13 07:05:00

In reply to:

//mail($to, "Order", $msg);


Remove the two forward slashes.

Re: PHP mailform

Posted by: bluestorm909
Posted on: 2006-07-15 16:44:00

oh yeah i forgot to leave the // out.

but It's still not working :(

Re: PHP mailform

Posted by: silkrooster
Posted on: 2006-07-15 22:15:00

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.
Silk

Re: PHP mailform

Posted by: bluestorm909
Posted on: 2006-07-17 08:16:00

thanks, it's still not working though. :(

Re: PHP mailform

Posted by: scjessey
Posted on: 2006-07-17 10:50:00

In reply to:

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.

Tags: php