Enfin j'ai réussi à envoyer un mail à partit de mon site!!
la fonction fonctionne parfaitement mais le prob c qu'elle ne peut envoyer que vers les adreese mail standard c à d yahoo, gmail, hotmail..... mais lorsque je l'envoi à une adresse bien particulier par exemple comme yamyoung@nom_société.com ou mail@developpez.com ne voulait pas fonctionner!! j'ai rien reçu!!!!


voila le code que j'ai travaillé avec :
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
 
 
<?php
     // Plusieurs destinataires
     $to  = 'aidan@example.com' . ', '; 
     $to .= 'wez@example.com';
 
     // Sujet
     $subject = 'Calendrier des anniversaires pour Août';
 
     // message
     $message = '
     <html>
      <head>
       <title>Calendrier des anniversaires pour Août</title>
      </head>
      <body>
       <p>Voici les anniversaires à venir au mois d\'Août !</p>
       <table>
        <tr>
         <th>Personne</th><th>Jour</th><th>Mois</th><th>Année</th>
        </tr>
        <tr>
         <td>Josiane</td><td>3</td><td>Août</td><td>1970</td>
        </tr>
        <tr>
         <td>Emma</td><td>26</td><td>Août</td><td>1973</td>
        </tr>
       </table>
      </body>
     </html>
     ';
 
     // Pour envoyer un mail HTML, l'en-tête Content-type doit être défini
     $headers  = 'MIME-Version: 1.0' . "\r\n";
     $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
 
     // En-têtes additionnels
     $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
     $headers .= 'From: Anniversaire <anniversaire@example.com>' . "\r\n";
     $headers .= 'Cc: anniversaire_archive@example.com' . "\r\n";
     $headers .= 'Bcc: anniversaire_verif@example.com' . "\r\n";
 
     // Envoi
     mail($to, $subject, $message, $headers);
?>
Et merci pour l'aide