Unable to send HTML email in PHP

I am using this script to send an email…


function secure($sec) {
return mysql_real_escape_string( htmlspecialchars ($sec) );
} 

function sendHTMLemail($to, $subject, $from, $body) { 
if (ereg("(.*)< (.*)>", $from, $regs)) {
	   $from = '=?iso-8859-8?B?'.base64_encode($regs[1]).'?= < '.$regs[2].'>';
	} else {
	   $from = $from;
	}

    $headers = "From: $from\\r\
";
    $headers .= "MIME-Version: 1.0\\r\
";
    $boundary = uniqid("HTMLEMAIL");
    $headers .= "Content-Type: multipart/alternative;".
                "boundary = $boundary\\r\
\\r\
";
    $headers .= "This is a MIME encoded message.\\r\
\\r\
";
    $headers .= "--$boundary\\r\
".
                "Content-Type: text/plain; iso-8859-8\\r\
".
                "Content-Transfer-Encoding: base64\\r\
\\r\
";
    $headers .= chunk_split(base64_encode(strip_tags($body)));
    $headers .= "--$boundary\\r\
".
                "Content-Type: text/html; charset=iso-8859-8\\r\
".
                "Content-Transfer-Encoding: base64\\r\
\\r\
";
    $headers .= chunk_split(base64_encode($body)); 

    $result = mail($to,'=?iso-8859-8?B?'.base64_encode($subject).'?=',"",$headers);
    return $result;
}

if (isset($_POST['Name']) && isset($_POST['Phone']) && isset($_POST['property']) && isset($_POST['email']) && isset($_POST['region']) && isset($_POST['Select1']))
{
	$Name = secure($_POST['Name']);
	$Phone = secure($_POST['Phone']);
	$property = secure($_POST['property']);
	$email = secure($_POST['email']);
	$region = secure($_POST['region']);
	$Select1 = secure($_POST['Select1']);
	
	$success = $error=""
	$to = "mymail@mymail.com";
	$body = "blabla";
	$subject = "blabla";
	if (sendHTMLemail($to, $subject, $email, $body))
		$success = "Succesfully sent!";
	else
		$error = "Error!";	
}

and I keep getting error’s no matter if I change the mail/body/subject
whats wrong with that?

It would be helpful if you shared those errors…

your putting your content string into $headers

your not passing any content to the mail

the mail() config should be


mail($to, $subject, $message, $headers);

I dont get any errors only the
“Error!” text from my script telling me sendHTMLEmail failed…


	if (sendHTMLemail($to, $subject, $email, $body))
		$success = "Succesfully sent!";
	else
		$error = "Error!";	

Mandes, its still not working… :\

Show us the latest version with the changes you implemented following Mandes recommendations please.

mmm this is wierd when im trying to use this script on my hosting package at beastserv(http://www.beastserv.com/) host it works perfect…
but when im trying to run it on my hosting package at https://manage.ixwebhosting.com
it doesnt send me the message… how is that possible?

There’s not much point telling us the symptoms and avoiding our questions/requests is there. It won’t help you or us unless you’re willing to provide more detailed information.

IIRC ixwebhosting use windows - I know someone who used them years ago. That being the case you may have a problem as I suspect you may be using a SMTP server connecting to gmail to send email and as I’ve already told you gmail is picky about allowing altered from headers because of its anti-spam policy.

You do not have to show us the code but it will certainly help.

I have no problem in showing you the code I just thought you could help me without it.
any way this is the code:
http://pastebin.com/2gag5nYT
- you may not understand some of words since they are written in Hebrew…
but the code is the same :slight_smile:

Thank you very much for you help and time :)!

Generally no, we need to see code so that we can rule out errors etc. If we ask to see the code there is no point thinking to yourself that you don’t need to show it to us - it’s almost rude!

Secondly, please can you post the code HERE in this topic inside

 tags please. That site you've posted it on doesn't format the code very well and it makes it hard to understand.

Finally, Hebrew? - Doesn't worry me. If I can help, I will but I can't promise to solve the problem but if I can I will. I think everyone here will say the same.

I’m sorry if I was sound rude to you…
here you go:


<?php
function secure($sec) {
return htmlspecialchars ($sec);
} 
 
function sendHTMLemail($to, $subject, $from, $body) { 
if (ereg("(.*)< (.*)>", $from, $regs)) {
	   $from = '=?iso-8859-8?B?'.base64_encode($regs[1]).'?= < '.$regs[2].'>';
	} else {
	   $from = $from;
	}

    $headers = "From: $from\\r\
";
    $headers .= "MIME-Version: 1.0\\r\
";
    $boundary = uniqid("HTMLEMAIL");
    $headers .= "Content-Type: multipart/alternative;".
                "boundary = $boundary\\r\
\\r\
";
    $headers .= "This is a MIME encoded message.\\r\
\\r\
";
    $headers .= "--$boundary\\r\
".
                "Content-Type: text/plain; iso-8859-8\\r\
".
                "Content-Transfer-Encoding: base64\\r\
\\r\
";
    $headers .= chunk_split(base64_encode(strip_tags($body)));
    $headers .= "--$boundary\\r\
".
                "Content-Type: text/html; charset=iso-8859-8\\r\
".
                "Content-Transfer-Encoding: base64\\r\
\\r\
";
    $headers .= chunk_split(base64_encode($body)); 

    $result = mail($to, $subject, $message, $headers); 

    return $result;
}

if (isset($_POST['Name']) && isset($_POST['Phone']) && isset($_POST['property']) && isset($_POST['email']) && isset($_POST['region']) && isset($_POST['Select1']))
{
	$Name = secure($_POST['Name']);
	$Phone = secure($_POST['Phone']);
	$property = secure($_POST['property']);
	$email = secure($_POST['email']);
	$region = secure($_POST['region']);
	$Select1 = secure($_POST['Select1']);
	
	$success = $error="";
	$to = "danrevah@hotmail.com";
	$subject = "&#1504;&#1493;&#1510;&#1512; &#1488;&#1497;&#1514;&#1498; &#1511;&#1513;&#1512; &#1502;&#1492;&#1488;&#1514;&#1512; &#1492;&#1512;&#1488;&#1500; &#1504;&#1491;&#1500;&#1503;";
	$body = "<html><body><center><div align=\\"right\\">&#1513;&#1501; &#1502;&#1500;&#1488;: ".$Name."<br>&#1502;&#1505;&#1508;&#1512; &#1492;&#1496;&#1500;&#1508;&#1493;&#1503; &#1513;&#1492;&#1493;&#1494;&#1503;: ".$Phone."<br><br>&#1499;&#1514;&#1493;&#1489;&#1514; &#1492;&#1502;&#1497;&#1497;&#1500; &#1513;&#1492;&#1493;&#1494;&#1504;&#1492;: ".$email."<br>&#1505;&#1493;&#1490; &#1492;&#1504;&#1499;&#1505;: ".$property."<br>&#1488;&#1494;&#1493;&#1512; &#1502;&#1489;&#1493;&#1511;&#1513;:".$region."<br>&#1502;&#1497;&#1493;&#1506;&#1491; &#1500;: ".$Select1.'</div></center></body></html>';
	if (sendHTMLemail($to, $subject, $email, $body))
		$success = "&#1492;&#1492;&#1493;&#1491;&#1506;&#1492; &#1504;&#1513;&#1500;&#1495;&#1492; &#1489;&#1492;&#1510;&#1500;&#1495;&#1492;!";
	else
		$error = "&#1488;&#1497;&#1512;&#1506;&#1492; &#1513;&#1490;&#1497;&#1488;&#1492; &#1489;&#1513;&#1500;&#1497;&#1495;&#1514; &#1492;&#1491;&#1493;&#1488;&#1512;. &#1488;&#1504;&#1488; &#1504;&#1505;&#1492; &#1513;&#1504;&#1497;&#1514; &#1502;&#1488;&#1493;&#1495;&#1512; &#1497;&#1493;&#1514;&#1512;";	
}
?>
<!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" dir="ltr" lang="en-US" xml:lang="en" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
    <!--
    Created by Artisteer v2.3.0.23326
    Base template (without user's data) checked by http://validator.w3.org : "This page is valid XHTML 1.0 Transitional"
    -->
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <title>&#1492;&#1512;&#1488;&#1500; &#1504;&#1491;&#1500;&quot;&#1503; </title>

    <script type="text/javascript" src="script.js"></script>

    <link rel="stylesheet" href="style.css" type="text/css" media="screen" />
    <!--[if IE 6]><link rel="stylesheet" href="style.ie6.css" type="text/css" media="screen" /><![endif]-->
    <!--[if IE 7]><link rel="stylesheet" href="style.ie7.css" type="text/css" media="screen" /><![endif]-->
	<style type="text/css">
.style1 {
				font-size: medium;
				color: #545454;
}
.style2 {
				text-align: right;
}
.style3 {
				text-align: center;
}
.style5 {
				color: #292929;
}
.style6 {
				font-family: Georgia, "Times New Roman", Times, Serif;
				color: #292929;
				height: 1%;
				text-align: center;
				margin: 0;
}
.style7 {
				margin-bottom: 0px;
}
.style9 {
				font-family: Arial;
}
.style11 {
				text-decoration: none;
				margin: 0.2em 0;
				padding: 0;
				font-weight: normal;
				font-style: normal;
				letter-spacing: normal;
				word-spacing: normal;
				font-variant: normal;
				text-decoration: none;
				font-variant: normal;
				text-transform: none;
				text-align: center;
				text-indent: 0;
				line-height: inherit;
				font-family: Arial;
				font-size: large;
				font-style: normal;
				font-weight: bold;
				color:white;background-color:silver;
}
.style12 {
				font-family: Arial;
				font-size: small;
				letter-spacing: normal;
				word-spacing: normal;
				font-style: normal;
				font-weight: normal;
				text-decoration: none;
				color: #B0B0B0;
				text-align: center;
				margin: 1em;
}
</style>
</head>
<body>
<div id="art-main" class="style3">
        <div class="art-Sheet">
            <div class="art-Sheet-tl"></div>
            <div class="art-Sheet-tr"></div>
            <div class="art-Sheet-bl"></div>
            <div class="art-Sheet-br"></div>
            <div class="art-Sheet-tc"></div>
            <div class="art-Sheet-bc"></div>
            <div class="art-Sheet-cl"></div>
            <div class="art-Sheet-cr"></div>
            <div class="art-Sheet-cc"></div>
            <div class="art-Sheet-body">
                <div class="art-Header">
                    <div class="art-Header-png"></div>
                    <div class="art-Header-jpeg"></div>
                </div>
                <div class="art-contentLayout">
                <hr noshade="noshade" />
                    <div class="art-content">
                        <div class="art-Post" style="left: 0px; top: 0px">
                            <div class="art-Post-body">
                        <div class="art-Post-inner">
                                        <div class="art-PostContent">
                                            
                                            
                                            <p class="style2" dir="RTL">
											<span lang="HE" style="line-height: 115%; font-family: &quot;Arial&quot;,&quot;sans-serif&quot;" class="style1">
											&#1492;&#1512;&#1488;&#1500; &#1504;&#1491;&#1500;&quot;&#1503; &#1492;&#1497;&#1504;&#1492; &#1495;&#1489;&#1512;&#1514; &#1514;&#1497;&#1493;&#1493;&#1498; &#1493;&#1492;&#1513;&#1511;&#1506;&#1493;&#1514; 
											&#1489;&#1504;&#1491;&#1500;&quot;&#1503; &#1513;&#1508;&#1493;&#1506;&#1500;&#1514; &#1489;&#1502;&#1511;&#1510;&#1493;&#1506;&#1497;&#1493;&#1514; &#1493;&#1489;&#1488;&#1502;&#1497;&#1504;&#1493;&#1514; 
											&#1490;&#1489;&#1493;&#1492;&#1492; &#1493;&#1502;&#1489;&#1496;&#1497;&#1495;&#1492; &#1502;&#1506;&#1504;&#1492; &#1493;&#1497;&#1495;&#1505; &#1488;&#1497;&#1513;&#1497; &#1493;&#1502;&#1497;&#1497;&#1491;&#1497; 
											&#1500;&#1499;&#1500; &#1508;&#1504;&#1497;&#1497;&#1492; &#1513;&#1500;&#1499;&#1501;. <br />
											&#1492;&#1495;&#1489;&#1512;&#1492; &#1502;&#1506;&#1502;&#1497;&#1491;&#1492; &#1500;&#1512;&#1513;&#1493;&#1514; &#1500;&#1511;&#1493;&#1495;&#1493;&#1514;&#1497;&#1492; &#1504;&#1497;&#1505;&#1497;&#1493;&#1503; 
											&#1512;&#1489; &#1493;&#1505;&#1497;&#1493;&#1506; &#1502;&#1511;&#1505;&#1497;&#1502;&#1488;&#1500;&#1497; &#1489;&#1488;&#1497;&#1514;&#1493;&#1512; &#1492;&#1504;&#1499;&#1505; &#1488;&#1493; 
											&#1500;&#1511;&#1493;&#1495; &#1492;&#1502;&#1514;&#1488;&#1497;&#1501; &#1500;&#1491;&#1512;&#1497;&#1513;&#1493;&#1514; &#1513;&#1500;&#1499;&#1501;, &#1489;&#1492;&#1513;&#1489;&#1495;&#1514; 
											&#1492;&#1504;&#1499;&#1505; &#1513;&#1500;&#1499;&#1501;, &#1489;&#1513;&#1497;&#1508;&#1493;&#1509; &#1493;&#1506;&#1497;&#1510;&#1493;&#1489; &#1489;&#1497;&#1514; &#1492;&#1495;&#1491;&#1513; 
											&#1513;&#1500;&#1499;&#1501;.&nbsp;
											&#1500;&#1511;&#1493;&#1495;&#1493;&#1514; &#1492;&#1495;&#1489;&#1512;&#1492; &#1497;&#1500;&#1493;&#1493; &#1489;&#1488;&#1493;&#1508;&#1503; &#1488;&#1497;&#1513;&#1497; &#1506;&#1500; &#1497;&#1491;&#1497; 
											&#1497;&#1493;&#1506;&#1509; &#1502;&#1511;&#1510;&#1493;&#1506;&#1497;, &#1488;&#1513;&#1512; &#1497;&#1512;&#1499;&#1494; &#1488;&#1514; &#1492;&#1491;&#1512;&#1497;&#1513;&#1493;&#1514; 
											&#1493;&#1492;&#1510;&#1512;&#1499;&#1497;&#1501; &#1513;&#1500;&#1499;&#1501; &#1493;&#1497;&#1497;&#1514;&#1503; &#1500;&#1499;&#1500; &#1488;&#1500;&#1492; &#1502;&#1506;&#1504;&#1492; 
											&#1502;&#1511;&#1510;&#1493;&#1506;&#1497; &#1493;&#1488;&#1502;&#1497;&#1503;, &#1493;&#1494;&#1488;&#1514; &#1489;&#1513;&#1497;&#1514;&#1493;&#1507; &#1508;&#1506;&#1493;&#1500;&#1492; &#1502;&#1500;&#1488; 
											&#1506;&#1501; &#1510;&#1493;&#1493;&#1514; &#1492;&#1502;&#1513;&#1512;&#1491; &#1493;&#1510;&#1493;&#1493;&#1514; &#1502;&#1511;&#1510;&#1493;&#1506;&#1497; &#1489;&#1514;&#1495;&#1493;&#1501;.</span><span dir="LTR" style="font-family:&quot;Arial&quot;,&quot;sans-serif&quot;"><o:p></o:p></span></p>
                                            
                                            
                                            <table class="table" width="100%" style="height: 307px">
                                            	<tr>
                                            		<td width="33%" valign="top">
                                            		<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" id="myMovieName" style="width: 450px; height: 294px">
<PARAM NAME=movie VALUE="C:\\Users\\Alon\\Desktop\\harel real estate\\flash\\harel.swf">
<PARAM NAME=quality VALUE=High>
<PARAM NAME=bgcolor VALUE=#ffffff>
<EMBED src="flash/harel.swf" quality=High bgcolor=#ffffff
NAME="myMovieName" ALIGN="" TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer" style="width: 450px; height: 294px">
</EMBED>
</OBJECT>

                                            		</td>
                                            		
                                            		</tr>
                                            </table>
                                                
                                        </div>
                        </div>
                        
                            </div>
                        </div>
                        <div class="art-Post" style="left: 0px; top: 0px">
                            <div class="art-Post-body">
                        <div class="style2">
                                        <h2 class="style11">?<span lang="he"> 
										&#1502;&#1506;&#1493;&#1504;&#1497;&#1497;&#1504;&#1497;&#1501; &#1500;&#1512;&#1499;&#1493;&#1513; &#1504;&#1499;&#1505; &#1500;&#1492;&#1513;&#1511;&#1506;&#1492; &#1488;&#1493; &#1500;&#1502;&#1490;&#1493;&#1512;&#1497;&#1501;&nbsp;
										</span></h2>
										<h2 class="style11"><span lang="he">&#1502;&#1500;&#1488;&#1493; 
										&#1488;&#1514; &#1508;&#1512;&#1496;&#1497;&#1499;&#1501;&nbsp; &#1493;&#1488;&#1495;&#1491; &#1502;&#1504;&#1510;&#1497;&#1490;&#1497;&#1504;&#1493; &#1497;&#1495;&#1494;&#1493;&#1512; 
										&#1488;&#1500;&#1497;&#1499;&#1501; &#1489;&#1492;&#1511;&#1491;&#1501;&nbsp; </span></h2>
                                        <div class="style3">
										<br />
										</div>
										<table width="100%">
										<tr>
										<td>
										<img src="images/contact.jpg" width="300" height="180" style="float: left;vertical-align:top;
										" /></td>
										<td>
                                        <div class="style6">
                                            <div class="style3">
                                            <!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript" Type="text/javascript"><!--
function FrontPage_Form2_Validator(theForm)
{

  if (theForm.Name.value == "")
  {
    alert("Please enter a value for the \\"Name\\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.Name.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \\"Name\\" field.");
    theForm.Name.focus();
    return (false);
  }

  if (theForm.&#1496;&#1500;&#1508;&#1493;&#1503;.value == "")
  {
    alert("Please enter a value for the \\"&#1496;&#1500;&#1508;&#1493;&#1503;\\" field.");
    theForm.&#1496;&#1500;&#1508;&#1493;&#1503;.focus();
    return (false);
  }

  if (theForm.&#1496;&#1500;&#1508;&#1493;&#1503;.value.length > 12)
  {
    alert("Please enter at most 12 characters in the \\"&#1496;&#1500;&#1508;&#1493;&#1503;\\" field.");
    theForm.&#1496;&#1500;&#1508;&#1493;&#1503;.focus();
    return (false);
  }

  var checkOK = "0123456789-.,";
  var checkStr = theForm.&#1496;&#1500;&#1508;&#1493;&#1503;.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    if (ch == ".")
    {
      allNum += ".";
      decPoints++;
    }
    else if (ch == "," && decPoints != 0)
    {
      validGroups = false;
      break;
    }
    else if (ch != ",")
      allNum += ch;
  }
  if (!allValid)
  {
    alert("Please enter only digit characters in the \\"&#1496;&#1500;&#1508;&#1493;&#1503;\\" field.");
    theForm.&#1496;&#1500;&#1508;&#1493;&#1503;.focus();
    return (false);
  }

  if (decPoints > 1 || !validGroups)
  {
    alert("Please enter a valid number in the \\"&#1496;&#1500;&#1508;&#1493;&#1503;\\" field.");
    theForm.&#1496;&#1500;&#1508;&#1493;&#1503;.focus();
    return (false);
  }

  if (theForm.email.value == "")
  {
    alert("Please enter a value for the \\"email\\" field.");
    theForm.email.focus();
    return (false);
  }

  if (theForm.email.value.length < 1)
  {
    alert("Please enter at least 1 characters in the \\"email\\" field.");
    theForm.email.focus();
    return (false);
  }
  return (true);
}
//--></script><!--webbot BOT="GeneratedScript" endspan -->
<?php  echo $success; echo $error; ?><br>
<form action="index.php" method="post">
                                            <!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="1" -->
											<input name="Name" dir="rtl" value="&#1513;&#1501; &#1502;&#1500;&#1488;" class="style7" size="20"/>
											<br />
											<br />
															<!--webbot bot="Validation" s-data-type="Number" s-number-separators=",." b-value-required="TRUE" i-maximum-length="12" -->
											<input name="Phone" type="text" dir="rtl" value="&#1502;&#1505;' &#1496;&#1500;&#1508;&#1493;&#1503;" maxlength="12" style="height: 20px" /><br />
											<br />
 </span><!--webbot bot="Validation" b-value-required="TRUE" i-minimum-length="1" --><input name="email" type="text" dir="rtl" value="&#1499;&#1514;&#1493;&#1489;&#1514; &#1502;&#1497;&#1497;&#1500;" /><br />
															<br />
															<select name="property" dir="rtl" style="width: 66px">
															<option>&#1491;&#1497;&#1512;&#1514; &#1502;&#1490;&#1493;&#1512;&#1497;&#1501;
															</option>
															<option>&#1511;&#1512;&#1511;&#1506;
															</option>
															<option>&#1504;&#1499;&#1505; &#1502;&#1505;&#1495;&#1512;&#1497;
															</option>
															</select> :
															<span lang="he">&#1505;&#1493;&#1490; 
															&#1492;&#1504;&#1499;&#1505;</span><br />
															<br />
											<select name="region" dir="rtl" style="width: 55px">
											<option>&#1510;&#1508;&#1493;&#1503;</option>
											<option>&#1502;&#1512;&#1499;&#1494;</option>
											<option>&#1491;&#1512;&#1493;&#1501;</option>
											</select> : <span lang="he">&#1488;&#1497;&#1494;&#1493;&#1512; 
											&#1502;&#1489;&#1493;&#1511;&#1513;</span><br />
											<span lang="he"><br />
											<select name="Select1" dir="rtl" style="width: 72px">
											<option>&#1502;&#1490;&#1493;&#1512;&#1497;&#1501;</option>
											<option>&#1492;&#1513;&#1511;&#1506;&#1492;</option>
											</select> : &#1502;&#1497;&#1493;&#1506;&#1491;&nbsp; &#1500;&nbsp;
											<br />
											<br />
											<input type="submit" value="&#1513;&#1500;&#1497;&#1495;&#1492;" 
							                style="color: #ffffff; 
											background-color:#000000"/>
											 <br />
											<br />
											<br />
											</span>
											</form>
											</div>
                                                
                                        </div>
                                        <td>
										<img src="images/real-estate-finance1.jpg" width="300" height="180" /></td>
                                        </td>
                                        </tr>
                                        </table>
                                        <div class="cleared"></div>
                        </div>
                        
                        		<div class="cleared"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="cleared"></div><div class="art-Footer">
                    <div class="art-Footer-inner">
                        <a href="#" class="art-rss-tag-icon" title="RSS"></a>
                        <div class="art-Footer-text">
                            <p><span class="style9">&nbsp;<span lang="he">&#1494;&#1499;&#1493;&#1497;&#1493;&#1514; 
							&#1513;&#1497;&#1502;&#1493;&#1513;</span> | </span><span class="style9">&nbsp;| 
							</span><span lang="he" class="style9">
							<a href="mailto:ddtech@netvision.net.il">
							&#1510;&#1493;&#1512; &#1511;&#1513;&#1512;</a></span><span class="style9"><br />
                                <span lang="he">&#1499;&#1500; &#1492;&#1494;&#1499;&#1493;&#1497;&#1493;&#1514; &#1513;&#1502;&#1493;&#1512;&#1493;&#1514; &#1500;&#1492;&#1512;&#1488;&#1500; &#1504;&#1491;&#1500;&quot;&#1503;
							</span>&nbsp;© 2011 </span></p>
                        </div>
                    </div>
                    <div class="art-Footer-background"></div>
                </div>
        		<div class="cleared"></div>
            </div>
        </div>
        <div class="cleared"></div>
        <p class="style12" style="height: 13px"> <strong>&#1504;&#1489;&#1504;&#1492; &#1506;"&#1497; &#1488;&#1500;&#1493;&#1503; &#1499;&#1491;&#1493;&#1512;&#1497;</strong></p>
    </div>
    
</body>
</html>

You’re still not giving the mail() a $message argument…

and still putting your body text and MIME boundaries inside the $headers :frowning:

you need to change all the $headers


    $headers .= "This is a MIME encoded message.\\r\
\\r\
";
    $headers .= "--$boundary\\r\
".
                "Content-Type: text/plain; iso-8859-8\\r\
".
                "Content-Transfer-Encoding: base64\\r\
\\r\
";
    $headers .= chunk_split(base64_encode(strip_tags($body)));
    $headers .= "--$boundary\\r\
".
                "Content-Type: text/html; charset=iso-8859-8\\r\
".
                "Content-Transfer-Encoding: base64\\r\
\\r\
";
    $headers .= chunk_split(base64_encode($body)); 

to make the MIME message


    $message = "This is a MIME encoded message.\\r\
\\r\
";
    $message .= "--$boundary\\r\
".
                "Content-Type: text/plain; iso-8859-8\\r\
".
                "Content-Transfer-Encoding: base64\\r\
\\r\
";
    $message .= chunk_split(base64_encode(strip_tags($body)));
    $message .= "--$boundary\\r\
".
                "Content-Type: text/html; charset=iso-8859-8\\r\
".
                "Content-Transfer-Encoding: base64\\r\
\\r\
";
    $message .= chunk_split(base64_encode($body)); 

Thank you very much guys that solved me the problem… ! :slight_smile: