php script emails ok to gmail but to hotmail subject line goes screwy

Here is the code, also does not take the values from the sql server whereas with gmail it is sent correctly, also subject is ok with gmail. Thinking maybe hotmail has some kind of code stripping feature to protect either their users or their servers.

[php]
function mailme($sendto,$sendername,$from,$subject,$sendmailbody,$bcc="")
{
global $SERVER_NAME;
$subject = nl2br($subject);
$sendmailbody = nl2br($sendmailbody);
$sendto = $sendto;
if($bcc!="")
{
$headers = “Bcc: “.$bcc.”\n”;
}
$headers = “MIME-Version: 1.0\n”;
$headers .= “Content-type: text/html; charset=UTF-8\n”;
$headers .= “X-Priority: 3\n”;
$headers .= “X-MSMail-Priority: Normal\n”;
$headers .= “X-Mailer: PHP/”.“MIME-Version: 1.0\n”;
$headers .= “From: " . $from . “\n”;
$headers .= “Content-Type: text/html\n”;
mail(”$sendto","$subject","$sendmailbody","$headers");
[/php]

I should add the subject line is in Turkish and is extracted from a file saved as iso-8859-9 because of some other problems previously with the encoding. All the other files are utf-8. Is there something blatantly wrong I am doing or is it just a quirk with hotmail since it goes without any problems whatsoever to gmail address.

Thanks in advance.

Ignore the other code I was chasing the paper trail and thought that this previous file was controlling the mail output but it is actually this php file typed below. The question is still the same but the code is slightly different. Does anyone know why this would not output the required query values to an email that goes to hotmail but would do everthing in order for the email that goes to gmail. Surely it should be fairly easy but I just can’t get my head around it.
[php]

<?php include("include/config.php"); include("include/functions/import.php"); if($_REQUEST['fpsub'] == "1") { $user_email = cleanit($_REQUEST['email']); if($user_email == "") { $error .= "
  • ".$lang['12']."
  • "; } if($error == "") { $query="SELECT USERID,username,xxx FROM members WHERE email='".mysql_real_escape_string($user_email)."'"; $result=$conn->execute($query); $UID = $result->fields['USERID']; $xxx = $result->fields['xxx']; $un = $result->fields['username']; if($xxx == "") { if(intval($UID) > 0) { $xxx = generateCode(8); $mp = md5($xxx); $query = "UPDATE members SET password='".mysql_real_escape_string($mp)."', xxx='".mysql_real_escape_string($xxx)."' WHERE USERID='".mysql_real_escape_string($UID)."' AND status='1'"; $conn->execute($query); } } // Send E-Mail Begin $sendto = $user_email; $sendername = $config['site_name']; $from = $config['site_email']; $subject = $lang['50']; $sendmailbody = stripslashes($un).",

    "; $sendmailbody .= $lang['51']."
    "; $sendmailbody .= $lang['52']." $xxx

    "; $sendmailbody .= $lang['23'].",
    ".stripslashes($sendername); mailme($sendto,$sendername,$from,$subject,$sendmailbody,$bcc=""); // Send E-Mail End $msg .= "
  • ".$lang['53']."
  • "; } } STemplate::assign('error',$error); STemplate::assign('msg',$msg); STemplate::display('new.tpl'); ?>

    [/php]

    Thanks once again.

    Sponsor our Newsletter | Privacy Policy | Terms of Service