Elinde sağlam çalışan sorunsuz gönderen php mail fonksiyonu olan var mı acaba. Google da çok buldum ama hepsi sorunlu göndermiyor
5
●834
function EmailDosyaGonderici($kime,$kimden,$baslik,$eklenecekdosya,$metin) {
$es_dsy = basename($eklenecekdosya);
$gercek_dsy = $eklenecekdosya;
$bst_metin = $metin;
$html_metin = nl2br($bst_metin);
$random_hash = md5(date('r', microtime()));
$headers = "From: $kimden\r\nReply-To: $kimden";
$headers .= "\r\nContent-Type: multipart/mixed; boundary=\"PHP-mixed-".$random_hash."\"";
$attachment = chunk_split(base64_encode(file_get_contents($gercek_dsy)));
$hsl = <<< MAIL
--PHP-mixed-$random_hash
Content-Type: multipart/alternative; boundary="PHP-alt-$random_hash"
--PHP-alt-$random_hash
Content-Type: text/plain; charset="iso-8859-9"
Content-Transfer-Encoding: 7bit
$bst_metin
--PHP-alt-$random_hash
Content-Type: text/html; charset="iso-8859-9"
Content-Transfer-Encoding: 7bit
$html_metin
--PHP-alt-$random_hash--
--PHP-mixed-$random_hash
Content-Type: application/zip; name="$es_dsy"
Content-Transfer-Encoding: base64
Content-Disposition: attachment
$attachment
--PHP-mixed-$random_hash--
MAIL;
$mail_sent = mail( $kime, $baslik, $hsl, $headers );
if($mail_sent) {
$durum = "gitti";
}else { $durum = "gitmedi"; }
// echo "<pre>$hsl</pre>";
return $durum;
}