Vous êtes ici Codes PHP et MySQL > Email > Probleme d'envoi pour vos fichiers attachés ?

 

Probleme d'envoi pour vos fichiers attachés ?

Probleme d'envoi pour vos fichiers attachés ?
MIME Fonction
Cette fonction retourne Content-Type pour les fichiers attachés !
 
Mathieu
[20] sources en PHP voir
Code vu 6697 fois
Enregistré le 01 Sept 2004
  • Digg ce code sur digg.com
  • Bookmark ce code sur del.icio.us
  • Bookmark ce code sur Google
  • Bookmark ce code sur Yahoo
  • Ajoute Probleme d'envoi pour vos fichiers attachés ?
  • Partage ce code sur Facebook
 
 
 
 

Code Source


01.
02.
03.
04.
05.
06.
07.
08.
09.
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.
101.
102.
103.
104.
105.
106.
107.
108.
109.
110.
111.
112.
113.
114.
115.
116.
117.
118.
119.
120.
 
<?php
/******************************************************************************/
/*                                                                            */
/*                       __        ____                                       */
/*                 ___  / /  ___  / __/__  __ _____________ ___               */
/*                / _ \/ _ \/ _ \_\ \/ _ \/ // / __/ __/ -_|_-<               */
/*               / .__/_//_/ .__/___/\___/\_,_/_/  \__/\__/___/               */
/*              /_/       /_/                                                 */
/*                                                                            */
/*                                                                            */
/******************************************************************************/
/*                                                                            */
/* Titre          : Probleme d'envoi pour vos fichiers attachés ?             */
/*                                                                            */
/* URL            : http://www.phpsources.org/scripts58-PHP.htm               */
/* Auteur         : Mathieu                                                   */
/* Date édition   : 01 Sept 2004                                              */
/*                                                                            */
/******************************************************************************/


  function GetMIME($ext){
  $ext=strrchr($ext,".");
  switch(strtoupper($ext)){
  case ".DWG":    return "application/acad;";      break;
  case ".CCAD":   return "application/clariscad;"; break;
  case ".DRW":    return "application/drafting;";  break;
  case ".DXF":    return "application/dxf;";       break;
  case ".UNV":    return "application/i-deas;";    break;
  case ".IGS":    return "application/iges;";      break;
  case ".IGES":   return "application/iges;";      break;
  case ".ODA":    return "application/oda;";       break;
  case ".PDF":    return "application/pdf;";       break;
  case ".AI":     return "application/postscript;";break;
  case ".PS":     return "application/postscript;";break;
  case ".EPS":    return "application/postscript;";break;
  case ".PRT":    return "application/pro_eng;";   break;
  case ".RTF":    return "application/rtf;";       break;
  case ".SET":    return "application/set;";       break;
  case ".STL":    return "application/sla;";       break;
  case ".SOL":    return "application/solids;";    break;
  case ".STEP":   return "application/STEP;";      break;
  case ".STP":    return "application/STEP;";      break;
  case ".VDA":    return "application/vda;";       break;
  case ".MIF":    return "application/x-mif;";     break;
  case ".CSH":    return "application/x-csh;";     break;
  case ".DVI":    return "application/x-dvi;";     break;
  case ".HDF":    return "application/x-hdf;";     break;
  case ".LATEX":  return "application/x-latex;";   break;
  case ".CDF":    return "application/x-netcdf;";  break;
  case ".NC":     return "application/x-netcdf;";  break;
  case ".SH":     return "application/x-sh;";      break;
  case ".TCL":    return "application/x-tcl;";     break;
  case ".TEX":    return "application/x-tex;";     break;
  case ".TEXI":   return "application/x-texinfo;"; break;
  case ".TEXINFO":return "application/x-texinfo;"; break;
  case ".TR":     return "application/x-troff;";   break;
  case ".ROFF":   return "application/x-troff;";   break;
  case ".T":      return "application/x-troff;";   break;
  case ".MAN":    return "application/x-troff-man;";break;
  case ".ME":     return "application/x-troff-me;";break;
  case ".MS":     return "application/x-troff-ms;";break;
  case ".SRC":    return "application/x-wais-source;";break;
  case ".ZIP":    return "application/zip;";       break;
  case ".BCPIO":  return "application/x-bcpio;";   break;
  case ".CPIO":   return "application/x-cpio;";    break;
  case ".GTAR":   return "application/x-gtar;";    break;
  case ".SHAR":   return "application/x-shar;";    break;
  case ".SV4CPIO":return "application/x-sv4cpio;"; break;
  case ".SV4CRC": return "application/x-sv4crc;";  break;
  case ".TAR":    return "application/x-tar;";     break;
  case ".USTAR":  return "application/x-ustar;";   break;
  case ".AU":     return "audio/basic;";           break;
  case ".SND":    return "audio/basic;";           break;
  case ".AIF":    return "audio/x-aiff;";          break;
  case ".AIFF":   return "audio/x-aiff;";          break;
  case ".AIFC":   return "audio/x-aiff;";          break;
  case ".WAV":    return "audio/x-wav;";           break;
  case ".GIF":    return "image/gif;";             break;
  case ".IEF":    return "image/ief;";             break;
  case ".JPG":    return "image/jpeg;";            break;
  case ".JPEG":   return "image/jpeg;";        break;
  case ".JPE":    return "image/jpeg;";        break;
  case ".TIFF":   return "image/tiff;";        break;
  case ".TIF":    return "image/tiff;";        break;
  case ".RAS":    return "image/x-cmu-raster;";      break;
  case ".PNM":    return "image/x-portable-anymap;"; break;
  case ".PBM":    return "image/x-portable-bitmap;"; break;
  case ".PGM":    return "image/x-portable-graymap;";break;
  case ".PPM":    return "image/x-portable-pixmap;"; break;
  case ".RGB":    return "image/x-rgb;";          break;
  case ".XBM":    return "image/x-xbitmap;";      break;
  case ".XPM":    return "image/x-xpixmap;";      break;
  case ".XWD":    return "image/x-xwindowdump;";  break;
  case ".ZIP":    return "multipart/x-zip;";      break;
  case ".GZIP":   return "multipart/x-gzip;";      break;
  case ".HTM":    return "text/html; charset="iso-8859-1"";   break;
  case ".HTML":   return "text/html; charset="iso-8859-1"";   break;
  case ".G":      return "text/plain; charset="iso-8859-1"";  break;
  case ".H":      return "text/plain; charset="iso-8859-1"";  break;
  case ".C":      return "text/plain; charset="iso-8859-1"";  break;
  case ".CC":     return "text/plain; charset="iso-8859-1"";  break;
  case ".HH":     return "text/plain; charset="iso-8859-1"";  break;
  case ".M":      return "text/plain; charset="iso-8859-1"";  break;
  case ".F90":    return "text/plain; charset="iso-8859-1"";  break;
  case ".TXT":    return "text/plain; charset="iso-8859-1"";  break;
  case ".TRX":    return "text/richtext;";      break;
  case ".TSV":    return "text/tab-separated-values;";break;
  case ".ETX":    return "text/x-setext;";     break;
  case ".MPG":    return "video/mpeg;";        break;
  case ".MPE":    return "video/mpeg;";        break;
  case ".MPEG":   return "video/mpeg;";        break;
  case ".QT":     return "video/quicktime;";   break;
  case ".MOV":    return "video/quicktime;";   break;
  case ".AVI":    return "video/x-msvideo;";   break;
  case ".MOVIE":  return "video/x-sgi-movie;"; break;
  default:        return "application/octet-stream;"; break;
  }
} ?>

 

Fonctions du code

: Trouve la dernière occurrence d'un caractère dans une chaîne - (PHP 4, PHP 5)
: Renvoie une chaîne en majuscules - (PHP 4, PHP 5)
Ajouter un commentaire
Code de sécurité

Attention: Les champs marqués d'une étoile * sont obligatoires
 
Librairie PHP

Connexion

 
 

Email

 
 

PHP

 
 
 
 
    Offres d'emploi

Plus de 500 offres d'emploi PHP/MySQL

Offres d'emploi
 
    Editeur PHP
 
        Publicité