Jump to content

[SOLVED] mail help


chris_rulez001

Recommended Posts

hi ive made a mail sender and its not working it is saying:

 

 

Parse error: syntax error, unexpected T_IF in /home/www/hostsareus.awardspace.co.uk/mail.php on line 6

 

contactus.php:

 

<?php
session_start()
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>- Contact Us</title>
<link rel="stylesheet" href="css/stylesheet.css" />
<?php
include ('includes/mysql_connect_users.php');
include ('includes/general.php');
?>
</head>

<body>
<table width="86%" border="0" align="center">
  <tr>
    <td height="26" class="headerback"><?php echo $site_name; ?></td>
  </tr>
  <tr>
    <td class="topnav" height="5"><a href="index.php">Home</a> | <a href="terms.php">Terms</a> | <a href="faq.php">FAQ</a> | <a href="contactus.php">Contact Us</a> | <a href="upload.php">Upload</a> <?php if (!isset($_SESSION['username']) == false) echo "| <a href='logout.php'>Logout</a> ";
else{
echo "| <a href='login.php'>Login</a> | <a href='register.php'>Register</a> "; }?></td>
  </tr>
  <tr>
    <td class="siteback"><div align='center'><form action='mail.php' method='post'
enctype='multipart/form-data'>
      <p> </p>
      <p>Your Email: 
        <input name="email" type="text" id="email" />
      </p>
      <p>Subject:<br/> 
        <select name="subject" size="1" id="subject">
          <option selected="selected">Select</option>
          <option value="Complaint">Complaint</option>
          <option value="Support">Support</option>
          <option value="Problems">Problems</option>
        </select>
</p>
      <p>Message:<br/> 
        <textarea name="content" rows="5" id="content"></textarea>
      </p>
      <p>
        <input type="submit" name="Submit" value="Submit" />  
        <input type="reset" name="Submit3" value="Reset" />
      </p>
    </form></div>
    </td>
  </tr>
</table>
<br /><div align="center"><?php echo $copyright; ?></div><br />
</body>
</html>

 

mail.php:

 

<?php
$email = $_POST['email'];
$subject = $_POST['subject'];
$content = $_POST['content']

    if($email == ""){
echo "Please, go back and fill out your email<br>\n";
        }
    else if($subject == ""){
echo "Please, go back and fill out the subject<br>\n";
} 
    else if($content == ""){
echo "Please, go back and fill out the content<br>\n";
        }
    else{
        echo "Thank you for emailing us! A receipt of your submission will be e-mailed to you almost immediately.";
$mailContent= $content
$toAddress="myemail";
$subject=$subject;
$recipientSubject="Thank You";
$receiptMessage = "Thank you for your email us, we will contact you back as soon as possible";

mail($email, $subject, $content,"From:$toAddress");

mail($toAddress,$recipientSubject,$mailContent,"From:$email");
}
}
?>
</body>
</html>

Link to comment
Share on other sites


<?php
$email = $_POST['email'];
$subject = $_POST['subject'];
$content = $_POST['content'];

    if($email == ""){
echo "Please, go back and fill out your email<br>\n";
        }
    else if($subject == ""){
echo "Please, go back and fill out the subject<br>\n";
} 
    else if($content == ""){
echo "Please, go back and fill out the content<br>\n";
        }
    else{
        echo "Thank you for emailing us! A receipt of your submission will be e-mailed to you almost immediately.";
$mailContent= $content;
$toAddress="myemail";
$subject=$subject;
$recipientSubject="Thank You";
$receiptMessage = "Thank you for your email us, we will contact you back as soon as possible";

mail($email, $subject, $content,"From:$toAddress");

mail($toAddress,$recipientSubject,$mailContent,"From:$email");
}

?>

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.