Hoşgeldiniz, Ziyaretçi.Lütfen giriş yapın veya kayıt olun.
E-posta adresinize aktivasyon iletisi gelmediyse lütfen buraya tıklayın.

Kullanıcı adınızı, parolanızı ve aktif kalma süresini giriniz
Ana Sayfa Forum Arama Giriş Kayıt Ol
Simple Machines Forum Türkçe Yardım Sitesi > Simple Machines Forum > Dökümanlar > Konu: Hotmail'e giden bozuk karakterleri düzeltin
Sayfa: [1]   Aşağı git
« önceki sonraki »
Bu Konuyu GönderYazdır
Gönderen Konu: Hotmail'e giden bozuk karakterleri düzeltin  (Okunma Sayısı 1786 defa)
test
Mod & Theme Testing
*
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 113



Hotmail'e giden bozuk karakterleri düzeltin
« : Kasım 14, 2006, 08:44:02 ÖÖ »

Hotmail'e giden emaillerdeki Türkçe karakter sorunu çözüldü.

Önce, Sources/Subs-Post.php dosyasını açın.

Bulun:

Kod:
// Send off an email.
// Note: the $priority parameter is added merely for future compatibility.
function sendmail($to, $subject, $message, $from = null, $message_id = null, $send_html = false, $priority = 1, $hotmail_fix = null)
{
global $webmaster_email, $context, $modSettings, $txt, $scripturl;

// So far so good.
$mail_result = true;

// If the recipient list isn't an array, make it one.
$to_array = is_array($to) ? $to : array($to);

// Sadly Hotmail doesn't support character sets properly.
if ($hotmail_fix === null)
{
$hotmail_to = array();
foreach ($to_array as $i => $to_address)
{
if (preg_match('~@hotmail.[a-zA-Z\.]{2,6}$~i', $to_address) === 1)
{
$hotmail_to[] = $to_address;
$to_array = array_diff($to_array, array($to_address));
}
}

// Call this function recursively for the hotmail addresses.
if (!empty($hotmail_to))
$mail_result = sendmail($to, $subject, $message, $from, $message_id, $send_html, $priority, true);

// The remaining addresses no longer need the fix.
$hotmail_fix = false;

// No other addresses left? Return instantly.
if (empty($to_array))
return $mail_result;
}

// Get rid of slashes and entities.
$subject = un_htmlspecialchars(stripslashes($subject));
// Make the message use \r\n's only.
$message = str_replace(array("\r", "\n"), array('', "\r\n"), stripslashes($message));

// Make sure hotmail mails are sent as HTML so that HTML entities work.
if ($hotmail_fix && !$send_html)
{
$send_html = true;
$message = strtr($message, array("\r\n" => "<br />\r\n"));
$message = preg_replace('~(' . preg_quote($scripturl, '~') . '([?/][\w\-_%\.,\?&;=#]+)?)~', '<a href="$1">$1</a>', $message);
}

list (, $from_name) = mimespecialchars(addcslashes($from !== null ? $from : $context['forum_name'], '<>()\'\\"'), true, $hotmail_fix);
list (, $subject) = mimespecialchars($subject, true, $hotmail_fix);

// Construct the mail headers...
$headers = 'From: "' . $from_name . '" <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . ">\r\n";
$headers .= $from !== null ? 'Reply-To: <' . $from . ">\r\n" : '';
$headers .= 'Return-Path: ' . (empty($modSettings['mail_from']) ? $webmaster_email: $modSettings['mail_from']) . "\r\n";
$headers .= 'Date: ' . gmdate('D, d M Y H:i:s') . ' +0000' . "\r\n";

if ($message_id !== null && empty($modSettings['mail_no_message_id']))
$headers .= 'Message-ID: <' . md5($scripturl . microtime()) . '-' . $message_id . strstr(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from'], '@') . ">\r\n";
$headers .= "X-Mailer: SMF\r\n";

// pass this to the integration before we start modifying the output -- it'll make it easier later
if (isset($modSettings['integrate_outgoing_email']) && function_exists($modSettings['integrate_outgoing_email']))
{
if ($modSettings['integrate_outgoing_email']($subject, $message, $headers) === false)
return false;
}

$charset = isset($context['character_set']) ? $context['character_set'] : $txt['lang_character_set'];

list ($charset, $message, $encoding) = mimespecialchars($message, false, $hotmail_fix);

// Sending HTML?  Let's plop in some basic stuff, then.
if ($send_html)
{
// This should send a text message with MIME multipart/alternative stuff.
$mime_boundary = 'SMF-' . md5($message . time());
$headers .= 'Mime-Version: 1.0' . "\r\n";
$headers .= 'Content-Type: multipart/alternative; boundary="' . $mime_boundary . '"' . "\r\n";
$headers .= 'Content-Transfer-Encoding: ' . ($encoding == '' ? '7bit' : $encoding);

// Save the original message...
$orig_message = $message;

// But, then, dump it and use a plain one for dinosaur clients.
$message = un_htmlspecialchars(strip_tags(strtr($orig_message, array('</title>' => "\r\n")))) . "\r\n--" . $mime_boundary . "\r\n";

// This is the plain text version.  Even if no one sees it, we need it for spam checkers.
$message .= 'Content-Type: text/plain; charset=' . $charset . "\r\n";
$message .= 'Content-Transfer-Encoding: ' . ($encoding == '' ? '7bit' : $encoding) . "\r\n\r\n";
$message .= un_htmlspecialchars(strip_tags(strtr($orig_message, array('</title>' => "\r\n")))) . "\r\n--" . $mime_boundary . "\r\n";

// This is the actual HTML message, prim and proper.  If we wanted images, they could be inlined here (with multipart/related, etc.)
$message .= 'Content-Type: text/html; charset=' . $charset . "\r\n";
$message .= 'Content-Transfer-Encoding: ' . ($encoding == '' ? '7bit' : $encoding) . "\r\n\r\n";
$message .= $orig_message . "\r\n--" . $mime_boundary . '--';
}
// Text is good too.
else
{
$headers .= 'Content-Type: text/plain; charset=' . $charset . "\r\n";
if ($encoding != '')
$headers .= 'Content-Transfer-Encoding: ' . $encoding;
}

// SMTP or sendmail?
if (empty($modSettings['mail_type']) || $modSettings['smtp_host'] == '')
{
$subject = strtr($subject, array("\r" => '', "\n" => ''));
if (!empty($modSettings['mail_strip_carriage']))
{
$message = strtr($message, array("\r" => ''));
$headers = strtr($headers, array("\r" => ''));
}

foreach ($to_array as $to)
{
if (!mail(strtr($to, array("\r" => '', "\n" => '')), $subject, $message, $headers))
{
log_error(sprintf($txt['mail_send_unable'], $to));
$mail_result = false;
}

// Wait, wait, I'm still sending here!
@set_time_limit(300);
if (function_exists('apache_reset_timeout'))
apache_reset_timeout();
}
}
else
$mail_result = $mail_result && smtp_mail($to_array, $subject, $message, $send_html ? $headers : "Mime-Version: 1.0\r\n" . $headers);

// Everything go smoothly?
return $mail_result;
}

Değiştirin:

Kod:
// Send off an email.
// Note: the $priority parameter is added merely for future compatibility.
function sendmail($to, $subject, $message, $from = null, $message_id = null, $send_html = false, $priority = 1, $hotmail_fix = null)
{
global $webmaster_email, $context, $modSettings, $txt, $scripturl;

// Use sendmail if it's set or if no SMTP server is set.
$use_sendmail = empty($modSettings['mail_type']) || $modSettings['smtp_host'] == '';

// Line breaks need to be \r\n only in windows or for SMTP.
$line_break = $context['server']['is_windows'] || !$use_sendmail ? "\r\n" : "\n";

// So far so good.
$mail_result = true;

// If the recipient list isn't an array, make it one.
$to_array = is_array($to) ? $to : array($to);

// Sadly Hotmail doesn't support character sets properly.
if ($hotmail_fix === null)
{
$hotmail_to = array();
foreach ($to_array as $i => $to_address)
{
if (preg_match('~@hotmail.[a-zA-Z\.]{2,6}$~i', $to_address) === 1)
{
$hotmail_to[] = $to_address;
$to_array = array_diff($to_array, array($to_address));
}
}

// Call this function recursively for the hotmail addresses.
if (!empty($hotmail_to))
$mail_result = sendmail($hotmail_to, $subject, $message, $from, $message_id, $send_html, $priority, true);

// The remaining addresses no longer need the fix.
$hotmail_fix = false;

// No other addresses left? Return instantly.
if (empty($to_array))
return $mail_result;
}

// Get rid of slashes and entities.
$subject = un_htmlspecialchars(stripslashes($subject));
// Make the message use the proper line breaks.
$message = str_replace(array("\r", "\n"), array('', $line_break), stripslashes($message));

// Make sure hotmail mails are sent as HTML so that HTML entities work.
if ($hotmail_fix && !$send_html)
{
$send_html = true;
$message = strtr($message, array($line_break => '<br />' . $line_break));
$message = preg_replace('~(' . preg_quote($scripturl, '~') . '([?/][\w\-_%\.,\?&;=#]+)?)~', '<a href="$1">$1</a>', $message);
}

list (, $from_name) = mimespecialchars(addcslashes($from !== null ? $from : $context['forum_name'], '<>()\'\\"'), true, $hotmail_fix);
list (, $subject) = mimespecialchars($subject, true, $hotmail_fix);

// Construct the mail headers...
$headers = 'From: "' . $from_name . '" <' . (empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from']) . '>' . $line_break;
$headers .= $from !== null ? 'Reply-To: <' . $from . '>' . $line_break : '';
$headers .= 'Return-Path: ' . (empty($modSettings['mail_from']) ? $webmaster_email: $modSettings['mail_from']) . $line_break;
$headers .= 'Date: ' . gmdate('D, d M Y H:i:s') . ' +0000' . $line_break;

if ($message_id !== null && empty($modSettings['mail_no_message_id']))
$headers .= 'Message-ID: <' . md5($scripturl . microtime()) . '-' . $message_id . strstr(empty($modSettings['mail_from']) ? $webmaster_email : $modSettings['mail_from'], '@') . '>' . $line_break;
$headers .= 'X-Mailer: SMF' . $line_break;

// pass this to the integration before we start modifying the output -- it'll make it easier later
if (isset($modSettings['integrate_outgoing_email']) && function_exists($modSettings['integrate_outgoing_email']))
{
if ($modSettings['integrate_outgoing_email']($subject, $message, $headers) === false)
return false;
}

$charset = isset($context['character_set']) ? $context['character_set'] : $txt['lang_character_set'];

list ($charset, $message, $encoding) = mimespecialchars($message, false, $hotmail_fix);

// Sending HTML?  Let's plop in some basic stuff, then.
if ($send_html)
{
// This should send a text message with MIME multipart/alternative stuff.
$mime_boundary = 'SMF-' . md5($message . time());
$headers .= 'Mime-Version: 1.0' . $line_break;
$headers .= 'Content-Type: multipart/alternative; boundary="' . $mime_boundary . '"' . $line_break;
$headers .= 'Content-Transfer-Encoding: ' . ($encoding == '' ? '7bit' : $encoding);

// Save the original message...
$orig_message = $message;

// But, then, dump it and use a plain one for dinosaur clients.
$message = un_htmlspecialchars(strip_tags(strtr($orig_message, array('</title>' => $line_break)))) . $line_break . '--' . $mime_boundary . $line_break;

// This is the plain text version.  Even if no one sees it, we need it for spam checkers.
$message .= 'Content-Type: text/plain; charset=' . $charset . $line_break;
$message .= 'Content-Transfer-Encoding: ' . ($encoding == '' ? '7bit' : $encoding) . $line_break . $line_break;
$message .= un_htmlspecialchars(strip_tags(strtr($orig_message, array('</title>' => $line_break)))) . $line_break . "--" . $mime_boundary . $line_break;

// This is the actual HTML message, prim and proper.  If we wanted images, they could be inlined here (with multipart/related, etc.)
$message .= 'Content-Type: text/html; charset=' . $charset . $line_break;
$message .= 'Content-Transfer-Encoding: ' . ($encoding == '' ? '7bit' : $encoding) . $line_break . $line_break;
$message .= $orig_message . $line_break . "--" . $mime_boundary . '--';
}
// Text is good too.
else
{
$headers .= 'Content-Type: text/plain; charset=' . $charset . $line_break;
if ($encoding != '')
$headers .= 'Content-Transfer-Encoding: ' . $encoding;
}

// SMTP or sendmail?
if ($use_sendmail)
{
$subject = strtr($subject, array("\r" => '', "\n" => ''));
if (!empty($modSettings['mail_strip_carriage']))
{
$message = strtr($message, array("\r" => ''));
$headers = strtr($headers, array("\r" => ''));
}

foreach ($to_array as $to)
{
if (!mail(strtr($to, array("\r" => '', "\n" => '')), $subject, $message, $headers))
{
log_error(sprintf($txt['mail_send_unable'], $to));
$mail_result = false;
}

// Wait, wait, I'm still sending here!
@set_time_limit(300);
if (function_exists('apache_reset_timeout'))
apache_reset_timeout();
}
}
else
$mail_result = $mail_result && smtp_mail($to_array, $subject, $message, $send_html ? $headers : "Mime-Version: 1.0" . $line_break . $headers);

// Everything go smoothly?
return $mail_result;
}


Bul:
Kod:
// Convert all 'special' characters to HTML entities.
preg_replace('~[\x80-\x{10FFFF}]~eu', '$entityConvert("\1")', $string);

return array($charset, $string, '7bit');


değiştir:

Kod:
// Convert all 'special' characters to HTML entities.
return array($charset, preg_replace('~([\x80-\x{10FFFF}])~eu', '$entityConvert("\1")', $string), '7bit');




Sonra da ilk eklediğimiz kodda şunu bulun:

Kod:
// Line breaks need to be \r\n only in windows or for SMTP.
$line_break = $context['server']['is_windows'] || !$use_sendmail ? "\r\n" : "\n";

Eğer sunucunuz linux ise şöyle değiştirin:

Kod:
// Line breaks need to be \r\n only in windows or for SMTP.
$context['server']['is_windows'] = false;
$line_break = $context['server']['is_windows'] || !$use_sendmail ? "\r\n" : "\n";

Eğer windows ise de şöyle değiştirin:

Kod:
// Line breaks need to be \r\n only in windows or for SMTP.
$context['server']['is_windows'] = true;
$line_break = $context['server']['is_windows'] || !$use_sendmail ? "\r\n" : "\n";

Yazar: Harzem
Kayıtlı

Herşey www.smfturk.net ve SMF alemi için.
ercan_j
H-Full Member
*
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 128


Kalbim | Rapim | Nefretim


Site
Ynt: Hotmail'e giden bozuk karakterleri düzeltin
« Yanıtla #1 : Aralık 18, 2006, 11:04:02 ÖÖ »

bende smtp ayarları tam neden hotmaile mail gitmiyor
Kayıtlı

husmen73
Sr. Member
***
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 3166


Gülhin İnternet'e sitenizin tasarımını yaptırın.


Site
Ynt: Hotmail'e giden bozuk karakterleri düzeltin
« Yanıtla #2 : Aralık 19, 2006, 03:13:21 ÖÖ »

Alıntı sahibi: ercan_j üzerinde Aralık 18, 2006, 11:04:02 ÖÖ
bende smtp ayarları tam neden hotmaile mail gitmiyor

Spam listesine girmişsin büyük ihtimalle. Çok mail yollamanın sakıncaları bunlar işte. Hotmail'e mail atıp spam listesinden çıkmak istediğinizi söyleyin. Tabi hotmail'e mail atarken size geri bildirim postası geliyorsa spam listesinde olduğunuzu gösterir. Spam listesinden çıkmak oldukça zor olabilir bunuda unutma. Eğer spam listesinde değilseniz kaynak dosyalarınızı yenileyin yeterlidir. Buda çözüm olmazsa hesabınızdaki mail gönderme ayarlarını denetletin. Genelde mail göndermek için PHP STANDART özelliği kullanılır. Sizde bunu deneyin.
Kayıtlı


Anka Teması ve Oboj Teması satışa sunulmuştur.

www.gulhin.com
  

Bana ulaşmak isterseniz husmen100[at]hotmail.com mail adresimi kullanabilirsiniz. MSN Messenger üzerinden SMF konusunda yardım etmiyorum fakat Tema Tasarımı konusunda ücretli yardımcı olabilirim. Saygılarımla.

  
ercan_j
H-Full Member
*
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 128


Kalbim | Rapim | Nefretim


Site
Ynt: Hotmail'e giden bozuk karakterleri düzeltin
« Yanıtla #3 : Aralık 19, 2006, 09:43:44 ÖÖ »

spam listesi? birde fazla mail yollamadım
Kayıtlı

husmen73
Sr. Member
***
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 3166


Gülhin İnternet'e sitenizin tasarımını yaptırın.


Site
Ynt: Hotmail'e giden bozuk karakterleri düzeltin
« Yanıtla #4 : Aralık 20, 2006, 11:16:01 ÖS »

Alıntı sahibi: ercan_j üzerinde Aralık 19, 2006, 09:43:44 ÖÖ
spam listesi? birde fazla mail yollamadım
Spam listesini kısaca şöyle açıklayayım, o listeye girdiğinde mesela hotmail listesine girdiğinde hotmail'deki adreslere mail atamazsın.

PHP Standart Mail kullanarak deneme yaparmısın?
Kayıtlı


Anka Teması ve Oboj Teması satışa sunulmuştur.

www.gulhin.com
  

Bana ulaşmak isterseniz husmen100[at]hotmail.com mail adresimi kullanabilirsiniz. MSN Messenger üzerinden SMF konusunda yardım etmiyorum fakat Tema Tasarımı konusunda ücretli yardımcı olabilirim. Saygılarımla.

  
serserim86
H-Full Member
*
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 4


Ynt: Hotmail'e giden bozuk karakterleri düzeltin
« Yanıtla #5 : Ocak 15, 2007, 05:45:25 ÖS »

walla ne kadar tesekkür etsem az sağolasaın süper oldu
Kayıtlı
jagatai
H-Full Member
*
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 117


Ynt: Hotmail'e giden bozuk karakterleri düzeltin
« Yanıtla #6 : Ocak 28, 2007, 09:52:43 ÖÖ »

ben denedim olmadı siteden mail gönderilmesi için bir mod kullanıyorum ondan olabilir mi?
Kayıtlı

www.kahkahaforum.com

Smf den iyi şekilde anlayan birini sitemdeki kodları ayarlaması mod yüklemesi vs. kısaca teknik işleri yapması karşılığından admin yapabiliri olmadı sitesinin reklamanı yaparım Cheesy
husmen73
Sr. Member
***
Çevrimdışı Çevrimdışı

Mesaj Sayısı: 3166


Gülhin İnternet'e sitenizin tasarımını yaptırın.


Site
Ynt: Hotmail'e giden bozuk karakterleri düzeltin
« Yanıtla #7 : Ocak 28, 2007, 03:33:21 ÖS »

Alıntı sahibi: jagatai üzerinde Ocak 28, 2007, 09:52:43 ÖÖ
ben denedim olmadı siteden mail gönderilmesi için bir mod kullanıyorum ondan olabilir mi?
Olabilir tabi, bu sadece SMF sistemi ile gönderilen mail'ler içindir.
Kayıtlı


Anka Teması ve Oboj Teması satışa sunulmuştur.

www.gulhin.com
  

Bana ulaşmak isterseniz husmen100[at]hotmail.com mail adresimi kullanabilirsiniz. MSN Messenger üzerinden SMF konusunda yardım etmiyorum fakat Tema Tasarımı konusunda ücretli yardımcı olabilirim. Saygılarımla.

  
Sayfa: [1]   Yukarı git
Bu Konuyu GönderYazdır
Simple Machines Forum Türkçe Yardım Sitesi > Simple Machines Forum > Dökümanlar > Konu: Hotmail'e giden bozuk karakterleri düzeltin
« önceki sonraki »
 
Gitmek istediğiniz yer:  


Powered by SMF 1.1.16 | SMF © 2006-2011, Simple Machines | NewDef design by Bloc
Gulhin Internet Hizmetleri
Bu Sayfa 0.082 Saniyede 17 Sorgu ile Oluşturuldu
Yükleniyor...