Advertisement
Guest User

Untitled

a guest
Apr 1st, 2015
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2. $subject = '[Bordeaux 3] Fichier recotation '.date("Ymd");
  3.  
  4. // clé aléatoire de limite
  5. $boundary = md5(uniqid(microtime(), TRUE));
  6.  
  7. // Headers
  8. $headers = 'From: Sylvain Machefert <toto@toto.fr>'."\r\n";
  9. $headers .= 'Mime-Version: 1.0'."\r\n";
  10. $headers .= 'Content-Type: multipart/mixed;boundary='.$boundary."\r\n";
  11. $headers .= "\r\n";
  12.  
  13. // Message
  14. $msg = '--'.$boundary."\r\n";
  15. $msg .= 'Content-type:text/plain;charset=utf-8'."\r\n";
  16. $msg .= 'Content-transfer-encoding:8bit'."\r\n";
  17. $msg .= 'Bonjour, veuillez trouver ci-joint le fichier de recotation pour cette semaine. Ce fichier contient '.$nb_notices_maj.' exemplaires à mettre à jour'."\r\n\r\n";
  18.  
  19.  
  20. // Pièce jointe
  21. $msg .= '--'.$boundary."\r\n";
  22. $msg .= 'Content-type:text/csv;name=recotation_bx3_'.date("Ymd").".csv\r\n";
  23. # $msg .= 'Content-transfer-encoding:base64'."\r\n";
  24. $msg .= $csv_txt."\r\n";
  25.  
  26. // Fin
  27. $msg .= '--'.$boundary."\r\n";
  28.  
  29. // Function mail()
  30. $to = 'toot@alalla.com';
  31. if (mail($to, $subject, $msg, $headers))
  32. ...
  33. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement