Swift Mailer ekleri

0 Cevap php

PHP ile anında bir CSV kuruyorum, ben sonra Swift Mailer Message bu CSV dosyasını eklemek gerekir. Ben bağlama ile, CSV içinde 183 Rescource almak diske yazmadan. Diske yazmadan önce dosyayı ekleyerek aswell oluşturulan dosya üzerinde chunk_split (base64_encode (file_get_contents ()) kullanılarak oluşturulan dosya aswell file_get_content kullanarak denedi file_get_content ile ben CSV dosyasının her satırında sadece bir dize olsun, herkes yanlış ne yapıyorum biliyor musun?

if(!file_exists(_PS_ORDERS_DIR_.$orderDate.'/'.$file_name.'.csv'))
 {
  if($file = fopen (_PS_ORDERS_DIR_.$orderDate.'/'.$file_name.'.csv', 'x+'))
   {
   foreach ($list as $fields)
    {
     fputcsv($file, $fields);
    }



    $attachment['mime'] = 'application/vnd.ms-excel';
    $attachment['content'] = file_get_contents($file);
    $attachment['name'] = $order.'order';
  EDIT            
 Mail::Send(1, 'order_conf', 'Order CSV Attachment', $success, 'test@email.com', Address, NULL, NULL, $attachment); // attach and send
      }
      }

0 Cevap