Bonjour,
Je viens à vous car ça fait plus de 6h que je passe dessus et que je n'arrive pas à trouver le problème.
J'ai un formulaire où les visiteurs peuvent me laisser un e-mail avec pieces jointes.
Le problème : je ne reçois jamais les pièces jointes.
Sur hotmail, la pièce jointe reste à 0Ko et donc ne fonctionne pas.
Sur le webmail d'ovh, il m'ecrit qq chose comme :
[...]
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14--------------fed43c14b08eba9ddcd81c0c8b92dead Content-type: application/octet-stream Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="frn.pdf" JVBERi0xLjINJeLjz9MNCjI3NiAwIG9iag08PCANL0xpbmVhcml6ZWQgMSANL08gMjc4IA0vSCBb IDEyODQgMjcxIF0gDS9MIDE4OTMxMyANL0UgMTQxOTY5IA0vTiA5IA0vVCAxODM2NzQgDT4+IA1l bmRvYmoNICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB4cmVmDTI3NiAzMCANMDAwMDAwMDAxNiAwMDAwMCBuDQowMDAwMDAwOTUxIDAwMDAwIG4NCjAw MDAwMDE1NTUgMDAwMDAgbg0KMDAwMDAwMTkxMiAwMDAwMCBuDQowMDAwMDAyMzYwIDAwMDAwIG4N CjAwMDAwMDI1NzcgMDAwMDAgbg0KMDAwMDA3MzA2NCAwMDAwMCBuDQowMDAwMDczMjQ1IDAwMDAw IG4NCjAwMDAwNzMyNjcgMDAwMDAgbg0KMDAwMDEzNjQwNCAwMDAwMCBuDQowMDAwMTM2NjIzIDAw MDAwIG4NCjAwMDAxMzY4MzYgMDAwMDAgbg0KMDAwMDEzNzE2NiAwMDAwMCBuDQowMDAwMTM3Nzcw IDAwMDAwIG4NCjAwMDAxMzc3OTIgMDAwMDAgbg0KMDAwMDEzODMxNCAwMDAwMCBuDQowMDAwMTM4
Je ne vois que ça mais pas de pièce jointe... mais bizarre, sur outlook, on les voit !
Alors comment faire pour que ces webmails (ovh et hotmail) voient la pièce jointe SVP ???
Je vous une fonction qui est concernée par ça :
J'ai essayé de mettre des tirets après le boundary car j'ai lu qu'il en fallait avant et après, de changer le content-transfer, de changer tout plein de choses mais ça ne fonctionne toujours pas...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 function _build_attachement() { $this->boundary= "------------" . md5( uniqid("myboundary") ); // TODO : variable bound $this->headers .= "MIME-Version: 1.0\nContent-Type: multipart/mixed;\n boundary=\"$this->boundary\"\n\n"; $this->fullBody = "This is a multi-part message in MIME format.\n--$this->boundary\nContent-Type: text/plain; charset=\"iso-8859-1\"\nContent-Transfer-Encoding: 8bit\n\n" . $this->body ."\n"; $sep= chr(13) . chr(10); $ata= array(); $k=0; // for each attached file, do... for( $i=0; $i < sizeof( $this->aattach); $i++ ) { $filename = $this->aattach[$i]; $basename = basename($filename); $ctype = $this->actype[$i]; // content-type $disposition = $this->adispo[$i]; if( ! file_exists( $filename) ) { echo "Class Mail, method attach : file $filename can't be found"; exit; } $subhdr= "--$this->boundary\nContent-type: $ctype;\n name=\"$basename\"\nContent-Transfer-Encoding: base64\nContent-Disposition: $disposition;\n filename=\"$basename\"\n"; $ata[$k++] = $subhdr; // non encoded line length $linesz= filesize( $filename)+1; $fp= fopen( $filename, 'r' ); $data= base64_encode(fread( $fp, $linesz)); fclose($fp); $ata[$k++] = chunk_split( $data ); } $this->attachment= implode($sep, $ata); }
Pouvez-vous m'aider SVP ??
Partager