Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

email is not sent after filling the form. showing fatal erro

the mail() function

Moderators: macek, egami, gesf

email is not sent after filling the form. showing fatal erro

Postby cjan » Sun Aug 19, 2012 12:46 am

I ve code for a contact us where viewer can fill a form as a feedback. when i click send then a fatal error is displayed as message. what is the error i tried to check but couldnot correct that error. please help me to sort this problem.
code is as follows
Code: Select all
<?php
if(isset($_POST['sub']))
{

     $fullname  = $_POST['fullname'];
     $email  = $_POST['email'];
     $subject  = $_POST['subject'];
     $message  = $_POST['message'];   
    
    
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";


$headers .= "From: $fullname <$email>\r\n";

$senderEmail  =  $funObj->getConfigValue("COMPANY_EMAIL");
$to  =  explode(",", $$senderEmail);
   foreach($to as $val)
   {
      
      $success =  $funObj->sendEmail($fullname, $email, $val, $message, "", false); <!-- Showing error in this line-->
   }
   
   if($success)
   {
   echo "Feedback is sent. Thanks for your feedback.";   
   }
}

?>

<form action="" method="post"  id="loginform">
<table width="400" border="0" cellpadding="5" cellspacing="5">
  <tr>
    <td colspan="2"><div id="loginErr" align="center"><h3>FeedBack Form</h3><hr></div></td>
    </tr>
  <tr>
    <td>Name</td>
    <td><label>
      <input type="text" name="fullname" id="fullname" />
    </label></td>
  </tr>
  <tr>
    <td>Email</td>
    <td><input type="email" name="email" id="email"/></td>
  </tr>
  <tr>
    <td>Subject</td>
    <td><input type="text" name="subject" id="subject"/></td>
  </tr>
   <tr>
    <td>Message</td>
    <td><textarea name="message" id="message" rows="10" cols="40"></textarea>
   
    </td>
  </tr>
 
 
 
  <tr>
    <td>&nbsp;</td>
    <td><label>
      <input type="submit" name="sub" id="sub" value="Send"  type=/>
    </label></td>
  </tr>
</table>

</form>
cjan
New php-forum User
New php-forum User
 
Posts: 3
Joined: Sun Apr 15, 2012 11:32 pm

Return to PHP coding => Mail

Who is online

Users browsing this forum: Google [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron