Jump to content

Where is the error?


lonewolf007

Recommended Posts

All I'm trying to do is create a simple form for a client of mine.  So that the fields that are entered will be sent to a email address.  

 

But when I click submit nothing happens.  I believe I'm missing something very basic from this form but just can't figure out what.  

 

 

okay Ill edit this. be back in a moment

Link to comment
https://forums.phpfreaks.com/topic/50753-where-is-the-error/
Share on other sites

<form name="CornerstoneForm" method="post"  action="sendmail.php">

 

and in sendmail.php write script like this.

 

<?php

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
  <title>Birthday Reminders for August</title>
</head>
<body>
  <p>Here are the birthdays upcoming in August!</p>
  <table>
    <tr>
      <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
    </tr>
    <tr>
      <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
    </tr>
    <tr>
      <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
    </tr>
  </table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n";
$headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";
$headers .= 'Bcc: [email protected]' . "\r\n";

// Mail it
mail('[email protected]', $subject, $message, $headers);
?> 

Link to comment
https://forums.phpfreaks.com/topic/50753-where-is-the-error/#findComment-249533
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.