Jump to content

how to send email


cerberus478

Recommended Posts

Hi I have a form that I want people to fill out and then click the button and it sends me an email. My problem is that it doesn't send me any emails, I have looked around and I don't seem to find any thing.

 

This is my form in application_form.php

 

<form action="application_form" method="POST">
<table border="0" cellpadding="5" cellspacing="0">
  <tr>
    <td>Full name</td>
    <td><input type="text" size="30" maxlength="80" name="name" /></td>
  </tr>
  <tr>
    <td>Email address</td>
    <td><input type="text" size="30" maxlength="80" name="email" /></td>
  </tr>
  <tr>
    <td>Message</td>
    <td><textarea name="message" cols="29" rows="5"></textarea></td>
  </tr>
  <tr>
    <td> </td>
    <td><input type="submit" name="submit" value="Submit Message" /></td>
  </tr>
</table>
</form>

 

and this is the php on the same application_form.php

<?php
if (isset($_POST['submit'])) {
  // Collect variables
  $name = $_POST['name'];
  $email = $_POST['email'];
  $message = $_POST['message'];

  // Send email
  $body = "The following feedback has been submitted:\n\n";
  $body .= "Name: $name\n";
  $body .= "Email: $email\n";
  $body .= "Message: $message";
  mail ("[email protected]","Feedback Received",$body,"From: [email protected]");

  // Output confirmation
  echo "<p>Your message has been received.</p>";
}
?>

Link to comment
https://forums.phpfreaks.com/topic/249888-how-to-send-email/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.