Quote:
I managed to send the email, but i receive it like all hashed or encrypted!! do you have any idea why?
Your mail is not properly formed. You can check it by inspecting the received plain text (how to show that depends on your mail client; with Thunderbird and some other clients the shortcut Ctrl+U can be used).
The first error is that you put all content into headers and have no body:
$flgSend = @mail($strTo,$strSubject,null,$strHeader);
Then there is no epilogue (end boundary).
Finally you are using "\n" line terminations while email requires CRLF terminated lines. Note that this applies also to your
$strMessage
text. See
PHP: mail - Manual[
^]:
Quote:
message
Message to be sent.
Each line should be separated with a CRLF (\r\n). Lines should not be larger than 70 characters.
Do it as intended and create strings for the header and the body, and use CRLF terminated lines:
$strHeader = "MIME-Version: 1.0\r\n";
$strHeader .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"\r\n";
$strBody = "This is a multi-part message in MIME format.\r\n";
$strBody .= "--".$strSid."\r\n";
$strBody .= "Content-type: text/html; charset=utf-8\r\n";
$strBody .= "Content-Transfer-Encoding: 8bit\r\n\r\n";
$strBody .= $strMessage."\r\n\r\n";
$strBody .= "--".$strSid."--\r\n";
$flgSend = mail($strTo,$strSubject,$strBody,$strHeader);