email - Unable to send HTML mail through mail() -


the mail sent below code includes html tags. how can rid of tried few ways still mail output scrambled html tags. , need on if better way of sending array of elements through mail();

my code:

<?php     include('mail.php');     include('mail\mime.php');      $errors=array();     if(empty ($_post)===false)     {         //$product = $_post['product'];         //$quantity = $_post['quantity'] ;         $email="noreply@cortexonline.in";         $item1 = $_post['product']['1'];         $item2 = $_post['product']['2'];         $item3 = $_post['product']['3'];         $item4 = $_post['product']['4'];         $item5 = $_post['product']['5'];         $quan1 = $_post['quantity']['1'];         $quan2 = $_post['quantity']['2'];         $quan3 = $_post['quantity']['3'];         $quan4 = $_post['quantity']['4'];         $quan5 = $_post['quantity']['5'];         $message = "<html><head><title></title>             </head> <body> <table>                  <tr><td>shop id=</td>                 </tr><tr><td>product name</td>                     <td>quantity</td></tr>                 <tr><td>".$item1."</td>                     <td>".$quan1."</td></tr>                 <tr><td>".$item2."</td>                     <td>".$quan2."</td></tr>                 <tr><td>".$item3."</td>                     <td>".$quan3."</td></tr>                 <tr><td>".$item4."</td>                     <td>".$quan4."</td><td>".$item5."</td><td>".$quan5."</td></tr>             </table></body></html>";         $header = 'from: "quick order" <noreply@cort.in>'.php_eol.             'reply-to: <noreply@cort.in>'.php_eol.             'mime-version: 1.0'.php_eol.             'content-type: text/plain; charset=utf-8'.php_eol.             'content-transfer-encoding: 8bit'.php_eol.             'x-mailer: php/'.php_version.php_eol;     if(ctype_alpha($quan1)===true||ctype_alpha($quan2)===true||ctype_alpha($quan3)==true||ctype_alpha($quan4)===true||ctype_alpha($quan5)===true)     {         $errors[]=' quantity cannot alphabet /n             cannot send request';     }      if(isset($_post['send'])===true)     {                if (empty($errors)===false)         {             echo '<script language="javascript">alert("not sent! qunatity cannot alphabet")</script>';         }         else         {             mail('order@cortexonline.in','quick order',$message,$header);              echo '<script language="javascript">alert("your order sent!")</script>';             echo '<script language="javascript">window.location = "index.php"</script>';         }     }     else     {         echo '<script language="javascript">alert("order not sent! please try again.")</script>';         echo '<script language="javascript">window.location = "index.php"</script>';     } } ?>  

also tried using single quotes not working.

try this:

$header = 'from: "quick order" <noreply@cort.in>'.php_eol.             'reply-to: <noreply@cort.in>'.php_eol.             'mime-version: 1.0'.php_eol.             'content-type: text/html; charset=utf-8'.php_eol.             'content-transfer-encoding: 8bit'.php_eol.             'x-mailer: php/'.php_version.php_eol; 

Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -