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 ("cerberus478@gmail.com","Feedback Received",$body,"From: cerberus478@gmail.com");

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

Link to comment
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.