Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $subject = '[Bordeaux 3] Fichier recotation '.date("Ymd");
- // clé aléatoire de limite
- $boundary = md5(uniqid(microtime(), TRUE));
- // Headers
- $headers = 'From: Sylvain Machefert <toto@toto.fr>'."\r\n";
- $headers .= 'Mime-Version: 1.0'."\r\n";
- $headers .= 'Content-Type: multipart/mixed;boundary='.$boundary."\r\n";
- $headers .= "\r\n";
- // Message
- $msg = '--'.$boundary."\r\n";
- $msg .= 'Content-type:text/plain;charset=utf-8'."\r\n";
- $msg .= 'Content-transfer-encoding:8bit'."\r\n";
- $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";
- // Pièce jointe
- $msg .= '--'.$boundary."\r\n";
- $msg .= 'Content-type:text/csv;name=recotation_bx3_'.date("Ymd").".csv\r\n";
- # $msg .= 'Content-transfer-encoding:base64'."\r\n";
- $msg .= $csv_txt."\r\n";
- // Fin
- $msg .= '--'.$boundary."\r\n";
- // Function mail()
- $to = 'toot@alalla.com';
- if (mail($to, $subject, $msg, $headers))
- ...
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement