Problem with mail function

I need to send html email to the emails i collect from Textboxes. my code is a follows.
I am having following problems.

[LIST=1]
[]The email is not sent in HTML format.
[
]The “[COLOR=darkred]from[/COLOR]” address on the recievers email client appears as " [COLOR=darkred]senders[/COLOR] [COLOR=darkred]email [/COLOR][COLOR=darkred]address@mycurrent[/COLOR][COLOR=darkred] webhost account[/COLOR]". I want it to only show the senders email address.
[/LIST]my code is a follows.

<?php

  for ($i = 1; $i <= 10; $i++) 
  {
  $name = $_POST['n'.$i];  
  $to = $_POST['e'.$i];
  $sname=$_POST['sname'];
  $semail=$_POST['semail'];
  $msg=$_POST['message'];
  $card=$_POST['cardname'];
  $today=time();
  $time= ($today + $i);
  if($to == ''){echo "";}else{
   
 $headers  = 'MIME-Version: 1.0' . "
";
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
 $headers =  "From:" .$semail;
 $subject = $sname . "has sent you an ecard from www.bestwishes.com.np ";
 $message = "Dear " .$name . ", You have recieved an ecard from" .$sname." <\br>
In order to pick your greeting, please click on the following link: <a href ='www.bestwishes.com.np/pickup.php?action=view&personalize=".$time."'>www.bestwishes.com.np/pickup.php?action=view&personalize=".$time."</a> </br>
 If the above link doesnot work, Try visiting <a href= 'www.bestwishes.com.np'>http://www.bestwishes.com.np</a> and insert your card id ".$time. " and click on Pick Up Button 
 Best Regards 
 www.bestwishes.com.np" ;//*/
 if(mail($to, $subject, $message, $headers ))
 {
  echo "Dear ".$sname.",</br> 
 Your card has been sent to ".$email."
</br> With following Personalized no. " .$time. "
</br>";
 }
 else
 {
  echo "Mail could not be sent to specified Email Address";
 }
//$today=time();
//echo $today;
  }//else {echo "";}
  }
  
 ?>

Please make the required modifications for me…

[COLOR=red]*Note[/COLOR] [SIZE=1]: $name = recievers name, $to = recievers email, sname=senders name, semail= senders email[/SIZE]


$headers  = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$headers .=  "From:" .$semail;

You didn’t concatenate the last line of your $headers variable.

The soln didnt solve both my problems
Please i need urgent help

[quote=utsav;2355766]The soln didnt solve both my problems
Please i need urgent help[/quote]

I’m sorry, I want to help you, but I need you to be clear about what your problems still are.

Did the solution solve either of your problems?

Thanks for the effort man. well i found out the solution

Would you mind sharing the solution?

Sure always happy to help man !! Well my code might not be upto the mark . And HTML might be just too long. But if it helps any other user like me, I’ll be more than happy.

<?php
  for ($i = 1; $i <= 10; $i++) 
  {
  $name = $_POST['n'.$i];  
  $to = $_POST['e'.$i];
  $sname=$_POST['sname'];
  $semail=$_POST['semail'];
  $msg=$_POST['message'];
  $card=$_POST['cardname'];
  $today=time();
  $time= ($today + $i);
  if($to == ''){echo "";}else{
  //$personalize=random_string('unique', 10);
  // To send HTML mail, the Content-type header must be set
 $headers  = 'MIME-Version: 1.0' . "
";
 $headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
 $headers .= "From: $semail
";
 $subject = $sname . "has sent you an ecard from www.bestwishes.com.np ";
 $message = '<html>
<head>
<title>..:: Bestwishes.com.np ::.. The best way to express</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<link href="http://www.bestwishes.com.np/css/d&i.css" rel="stylesheet" type="text/css">
<body>
<table width="400" border="0" cellspacing="0" cellpadding="0">
  <tr align="center" valign="middle" bgcolor="#000000"> 
    <td colspan="3"><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Bestwishes.com.np 
      <br>
      </font></td>
  </tr>
  <tr> 
    <td width="5%" bgcolor="#000000">&nbsp;</td>
    <td width="90%" valign="top" bgcolor="#FFFFFF"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td class="bodygreen">&nbsp;&nbsp;Dear ' .$name . ',<br>
            <br>
          </td>
        </tr>
        <tr> 
          <td><div align="center" class="bodyblue">You recieved an ecard from 
              ' .$sname.'. <br>
              Click Pick Up Button to pick your card.<br>
              <br>
            </div></td>
        </tr>
        <tr> 
          <td><div align="center"><a href="www.bestwishes.com.np/pickup.php?action=view&personalize='.$time.'"><img src="http://www.bestwishes.com.np/pikup.gif" width="150" height="40" border="0"></a></div></td>
        </tr>
        <tr>
          <td class="bodyblue"><div align="center"><br>
              &nbsp;If the button does not work. &nbsp;Visit <a href="http://www.bestwishes.com.np">http://www.bestwishes.com.np</a><br>
              &nbsp;And Enter your PCN<font color="#CC0000"> '.$time. ' </font>and 
              Click on Pick Up Card Button.<br>
              <br>
            </div></td>
        </tr>
      </table>
    </td>
    <td width="5%" bgcolor="#000000">&nbsp;</td>
  </tr>
  <tr bgcolor="#000000"> 
    <td colspan="3" class="bodyarticle"> 
      <div align="center"><font color="#FFFFFF" size="1"><br>
        </font></div></td>
  </tr>
</table>
</body>
</html>' ;//*/
 if(mail($to, $subject, $message, $headers ))
 {
  echo "Dear ".$sname.",</br> 
 Your card has been sent to " . $to . "
</br> With following Personalized no. " .$time. "
</br>";
 }
 else
 {
  echo "Dear ".$sname.",</br> 
 Your card could not be sent to " . $to ."Please Try again";
 }
//$today=time();
//echo $today;
  }//else {echo "";}
  }
  
 ?>

Basically the problem was with php variables inside the html tags in message body. and one of course was $headers concatenation.

Enjoy!!!