I'm writing a mail form in PHP, for my unfinished website... I need help with my mail form. I have a problem sending the message itself. I think my problem is in sendmail.php.
mail.php:
<h2>E-mail Form</h2> <p>All emails sent through this form will be sent to my email (chance@chance528.co.cc).</p> <form action="sendmail.php" method="post"> Name: <input type="text" name="name" width="50"/><br/> Subject: <input type="text" name="subject" width="100"/><br/> Message:<br/> <textarea cols="150" rows="25" name="message"></textarea><br/> <input type="submit" value="Send"/> </form>
sendmail.php:
$name = $_POST["name"];
$subj = $_POST["subject"];
$msg = $_POST["message"];
$mail = mail("chance@chance528.co.cc", $msg." : ".$subj, $msg);
if (!$mail) echo "<p>Message not sent.</p>";
else echo "<p>Message sent successfully.</p>";
I think it's with using $_POST. When I send the mail, It must have a Subject format of $msg : $subj. What appears in my webmail inbox is just " : ". What's wrong?
Thanks. Good night! It's 11:30 PM.

New Topic/Question
Reply




MultiQuote



|