• 13-06-2008, 09:44:04
    #1
    php ile mail gönderirken zip dosyasında göndermek istiyorum.
    Elinde sağlam çalışan sorunsuz gönderen php mail fonksiyonu olan var mı acaba. Google da çok buldum ama hepsi sorunlu göndermiyor
  • 13-06-2008, 10:46:40
    #2
    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;
    }
  • 14-06-2008, 10:44:31
    #3
    e insan bir teşekür bari eder, peeeh
  • 14-06-2008, 11:06:48
    #4
    Teşekkürler Haymac + rep
  • 14-06-2008, 11:26:29
    #5
    Sesiyada1903 adlı üyeden alıntı: mesajı görüntüle
    Teşekkürler Haymac + rep
    repe gerek yoktu, teşekür ederim.
    Esasen olay Mert'e kırılmak.
  • 14-06-2008, 13:03:04
    #6
    Kimlik doğrulama veya yönetimden onay bekliyor.
    teşekkürler