bonjour a tous,

voila, bon bah j'envoie un mail avec piece jointe qui marche du tonnerre sous outlook, mais sous yahoo, lorsque je recoit le mail avec la piece jointe nommée 'blabla.pdf', le fichier n'est pas joint et dans le corps du message je recois :

This is a multi-part message in MIME format. --------------b0eb737c46fa5a69d277f487bdb60bba Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit



mon message envoyé

--------------b0eb737c46fa5a69d277f487bdb60bba Content-type: application/pdf; name="blabla.pdf" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="blabla.pdf" DQpzZGZzZHFzZHFzZHFzZA0KcXNkeidyemVyKA0KcXNycWV6J3JxZXpycXpycXplDQpkcXF6ZXJ6 ZXF2cnF6DQpzZHF6cXplJyhlcnF2emUNCnN2cXp2KHFydnF6ZQ0KZHFzZnNkZnNkZnNkcnF6ZnNk ZnNkZnNkZnNkZnNicnFiJyhxeidxemQNCmRxc2ZzcmYgcWJlcmVycWV2cnF6YnplcnFlenJxZScN CmRxc2RlcnFlcnplcnpxZXJxeg0KcXNkemVyemV2cnF6ZXJxemVyenENCnFzZHF6ZXJ2emVycXpl cnpxZXINCnFzdnF6ZXJ2cXpyZXpycXpyDQpkcXNkcWVycXp2cXJlcnZxemUNCnNkcWV2cnFlenJx emVycXplcg0Kc2RxenJydnF6ZXJ6cnF6ZXJxDQpzZHF6ZXJ2cXJ2emVydnF6ZXJxemUNCnFzZGV6 cnZ2cnplcnpxZXJ2enFlDQpxc3F6ZXJ6cXJxemUNCmRxZXJ6cWVyenFlDQpzZHFzZGZxemVycXpl


bref, je comprends pas pourquoi yahoo refuse mon fichier joint!

pourtant mon code est assez classique :

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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
function _build_headers()
{
 
        // creation du header mail
 
        $this->headers= "From: $this->from\n";
		$this->headers .= 'Content-Type: text/plain; charset=UTF-8'."\r\n"; 
 
        $this->to= implode( ", ", $this->sendto );
 
        if( count($this->acc) > 0 ) {
                $this->cc= implode( ", ", $this->acc );
                $this->headers .= "CC: $this->cc\n";
        }
 
        if( count($this->abcc) > 0 ) {
                $this->bcc= implode( ", ", $this->abcc );
                $this->headers .= "BCC: $this->bcc\n";
        }
 
 
 
        if( $this->priority != "" )
                $this->headers .= "X-Priority: $this->priority\n";
 
}
 
 
 
/*
 *                _build_attachement()
 *                internal use only - check and encode attach file(s)
*/
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=us-ascii\nContent-Transfer-Encoding: 7bit\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\"\r\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 );
 
/*
                // OLD version - used in php < 3.0.6 - replaced by chunk_split()
                $deb=0; $len=76; $data_len= strlen($data);
                do {
                        $ata[$k++]= substr($data,$deb,$len);
                        $deb += $len;
                } while($deb < $data_len );
 
*/
        }
        $this->attachment= implode($sep, $ata);
}
 
// je gere l'extention du fichier
 
switch(strrchr(basename($name2), "."))
	{
 
		case ".gz": $filetype = "application/x-gzip"; break;
		case ".tgz": $filetype = "application/x-gzip"; break;
		case ".zip": $filetype = "application/zip"; break;
		case ".pdf": $filetype = "application/pdf"; break;
		case ".png": $filetype = "image/png"; break;
		case ".gif": $filetype = "image/gif"; break;
		case ".jpg": $filetype = "image/jpeg"; break;
		case ".txt": $filetype = "text/plain"; break;
		case ".htm": $filetype = "text/html"; break;
		case ".html": $filetype = "text/html"; break;
		case ".xls": $filetype = "application/vnd.ms-excel"; break;
		default: $filetype = "application/octet-stream"; break;
 
	}
 
 $m->Attach( "upload/$name2", $filetype );
$m->Send();


mais voila, sous yahoo, mon fichier n'est pas joint ; je ne comprends pas pourquoi.

d'avance, merchi !