Jump to content

Recommended Posts

Alright, so I am a PHP newbie, just started today! I have been learning for the past 4 hours though, so most of the terms you tell me I will understand. Now I will cut to the chase. I am writing a comment email form (as you would see if you were submitting a bug) Where all you do is type in your email and the message and then the form action sends you to my sendEmail.php with POST. I will get both files set up on here, but I need to know why I am not receiving the test email's I have sent  ???

 

Submit Comment

<html>
<head>
<title>PHP</title>
</head>
<body>

<fieldset>
<legend><b>E-Mail Form</b></legend>
<form action="sendMail.php" method="post">
E-Mail:
<br />
<input type="text" name="from" />
<br />
Message:
<br />
<textarea cols="40" rows="15" name="message"></textarea>
<br />
<input type="submit" value="Send"/>
</form>
</fieldset>

</body>
</head>

 

sendMail.php

<html>
<head>
<title>PHP welcome!</title>
</head>
<body>
<center>

<?php
$message=$_REQUEST['message'];
$from=$_REQUEST['from'];
$to="casemyster@gmail.com";
$subject="Comment PHP";
mail( $to, "Subject: $subject", $message, "From: $from" );
echo "Mail Successfully Sent.";
?>

<br />

<a href="phptest.php">Send Another</a>


</center>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/56472-email-form-help/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.