• 10-01-2007, 01:24:50
    #1
    Selam arkadaşlar;

    PHP ile mail gönderiyorum mail ile birlikte dosya nasıl göndertebiliriz.

     
    <?
    mail("gidecek@mail.com","Konu","Mesaj");
    ?>
    yukarıdaki koda en basit dosya gönderme kodunu ekliyebilirmisiniz, dosyayı serverdeki pathden alacak yani şu dosyayı göndersin istiyorum.

    C:\Inetpub\vhosts\test.com\httpdocs/test.exe

    Yardım edeceklere şimdiden tşk.
  • 10-01-2007, 14:39:56
    #2
    PHP Help: Complete PHP Mail Tutorial - Everything You Need to Know bu dökümanı inceleyebilirsiniz
  • 10-01-2007, 18:18:57
    #3
    Valla pek ing yok, basit bir kodu varsa yazabilirmisin tşk.
  • 13-01-2007, 00:52:49
    #4
    Örnek kod bilen varmı arkadaşlar TR içerik olursa sevinirim.
  • 13-01-2007, 01:59:09
    #5
    PHP Help: PHP Mail File Attachements

    Arkadaşın verdiği linkte bu sayfada geçiyor örnek kod vs.

    <?php
    
    // Grab our config settings
    require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
    
    // Grab the FreakMailer class
    require_once($_SERVER['DOCUMENT_ROOT'].'/lib/MailClass.inc');
    
    // instantiate the class
    $mailer = new FreakMailer();
    
    // Set the subject
    $mailer->Subject = 'This is a test';
    
    // Setup mail class, recipients and body
    $mailer->AddAttachment('/home/mywebsite/public_html/file.zip', 'file.zip'); 
    
    // Body
    $mailer->Body = 'This is a test of my mail system!';
    
    // Add an address to send to.
    $mailer->AddAddress('foo@host.com', 'Eric Rosebrock');
    
    if(!$mailer->Send())
    {
      echo 'There was a problem sending this mail!';
    }
    else
    {
      echo 'Mail sent!';
    }
    $mailer->ClearAddresses();
    $mailer->ClearAttachments();
    ?>