1 Replies - 906 Views - Last Post: 24 November 2010 - 09:30 PM Rate Topic: -----

#1 chance528  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 02-September 10

PHP Mail Form

Posted 24 November 2010 - 09:24 PM

hi.

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.

Is This A Good Question/Topic? 0
  • +

Replies To: PHP Mail Form

#2 chance528  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 27
  • Joined: 02-September 10

Re: PHP Mail Form

Posted 24 November 2010 - 09:30 PM

Sorry everyone. Works perfectly. I don't know what happened.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1