IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Mail bloqué - fonction mail()


Sujet :

Langage PHP

  1. #1
    Membre à l'essai
    Inscrit en
    Mars 2011
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 25
    Points : 18
    Points
    18
    Par défaut Mail bloqué - fonction mail()
    Bonjour à tous,

    Voila je vous explique mon probleme, j'utilise un script avec la fonction mail depuis maintenant 2ans, celui ci fonctionné parfaitement jusqu’à hier soir.
    Depuis tout les depart de mail de mon site ce retrouve bloqué.
    Voici ce que j'ai pu recupérer de l'hebergeur :

    Nous avons conservé 24 e-mails envoyés par la fonction mail() de php en log, ces emails ont été bloqués, vous pouvez analyser pourquoi en regardant le contenu des emails.

    Voici l'un des mails :

    Received: from mailler27.lws-hosting.com (localhost [127.0.0.1]) by filter1.lws (Postfix) with ESMTP id D2248C3EDD6 for ; Thu, 20 Feb 2014 13:32:23 +0100 (CET) Received: from localhost by mailler27.lws-hosting.com with SpamAssassin (version 3.3.1); Thu, 20 Feb 2014 13:32:24 +0100 From: "MonSite.com" To: monadresse@yahoo.com Subject: Monsite.com : Commande enregister Date: Thu, 20 Feb 2014 12:32:23 +0000 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mailler27.lws-hosting.com X-Spam-Flag: YES X-Spam-Level: ********** X-Spam-Status: Yes, score=10.7 required=8.0 tests=BAYES_50,FSL_MISSP_REPLYTO, MISSING_MID,YAHOO autolearn=no version=3.3.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----------=_5305F5D8.D8DA2E92" Message-Id: <20140220123223.D2248C3EDD6@mailler27.lws-hosting.com> This is a multi-part message in MIME format. ------------=_5305F5D8.D8DA2E92 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit ------------------ D�but de Rapport SpamAssassin --------------------- Ce message est probablement du SPAM (message non sollicit� envoy� en masse, publicit�, escroquerie...). Cette notice a �t� ajout�e par le syst�me d'analyse "SpamAssassin" sur votre serveur de courrier "mailler27.lws-hosting.com", pour vous aider � identifier ce type de messages. Le syst�me SpamAssassin ajoute un en-t�te "X-Spam-Flag: YES" aux messages qu'il consid�re comme �tant probablement du Spam. Vous pouvez si vous le souhaitez utiliser cette caract�ristique pour r�gler un filtre dans votre logiciel de lecture de courrier, afin de d�truire ou de classer � part ce type de message. Si ce robot a classifi� incorrectement un message qui vous �tait destin�, ou pour toute question, veuillez contacter l'administrateur du syst�me par e-mail � the administrator of that system . Voir http://spamassassin.apache.org/tag/ pour plus de d�tails (en anglais). D�tails de l'analyse du message: (10.7 points, 8.0 requis) 1.0 YAHOO YAHOO 4.0 BAYES_50 BODY: L'algorithme Bay�sien a �valu� la probabilit� de spam entre 40 et 60% [score: 0.5034] 1.2 MISSING_MID Missing Message-Id: header 4.5 FSL_MISSP_REPLYTO Mis-spaced from and Reply-to -------------------- Fin de Rapport SpamAssassin --------------------- ------------=_5305F5D8.D8DA2E92 Content-Type: message/rfc822; x-spam-type=original Content-Description: original message before SpamAssassin Content-Disposition: inline Content-Transfer-Encoding: 8bit Received: from Monsite.com (unknown [91.216.107.198]) by mailler27.lws-hosting.com (Postfix) with SMTP id CF48FC3ED85 for ; Thu, 20 Feb 2014 13:32:22 +0100 (CET) Received: by Monsite.com (sSMTP sendmail emulation); Thu, 20 Feb 2014 12:32:23 +0000 Date: Thu, 20 Feb 2014 12:32:23 +0000 To: monadresse@yahoo.com Subject: AlcoolPascher.com : Commande enregister X-PHP-Originating-Script: 2079:ficheClient.php From: "monSite.com" Reply-to: "no-reply@monsite.com" MIME-Version: 1.0 X-Mailer: PHP/5.3.28Content-Type: multipart/mixed; boundary="-----=a9152e478be4ccadbd351e7811ef5ab6" -------=a9152e478be4ccadbd351e7811ef5ab6 Content-Type: multipart/alternative; boundary="-----=a218088088b802ab716ff746b0fed212" -------=a218088088b802ab716ff746b0fed212 Content-Type: text/html; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit
    Tout cela est incompréhensible pour moi ! J'en appel a votre aide !!

    Merci

  2. #2
    Membre expert
    Avatar de Spartacusply
    Homme Profil pro
    Développeur Web
    Inscrit en
    Mai 2011
    Messages
    1 723
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Loire Atlantique (Pays de la Loire)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mai 2011
    Messages : 1 723
    Points : 3 274
    Points
    3 274
    Par défaut
    Apparement tes emails ont l'air d'être considéré comme des spams. Il y a peut-être eu un changement au niveau du filtre antispam de ton hébergeur qui a conduit à ce résultat.
    Un message utile vous a aidé ? N'oubliez pas le

    www.simplifions.fr - Simplifier vos comptes entre amis !

  3. #3
    Membre du Club
    Homme Profil pro
    IT Operator
    Inscrit en
    Mars 2013
    Messages
    43
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Vosges (Lorraine)

    Informations professionnelles :
    Activité : IT Operator
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2013
    Messages : 43
    Points : 44
    Points
    44
    Par défaut
    C'est bloqué parce que tes mails ont un trop faible score de spam.

    Le score varie en fonction de pleins de critères. Moi c'était bloqué une fois parce que j'avais mis une image qui lui plaisait pas..

    Je ne sais pas ce que contient ton mail donc difficile à dire, mais si tu testes avec une simple phrase par exemple, ça fait pareil ?

  4. #4
    Membre à l'essai
    Inscrit en
    Mars 2011
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 25
    Points : 18
    Points
    18
    Par défaut
    Re bonjour,

    L’hébergeur à bloqué ma fonction mail suite a ces erreurs.
    Es ce possible que vous y jeté un petit coup d’œil a mon code ?
    J'ai ecumé les forum et fait pas mal de test et de modif sur le header et le contenu mais rien n'y fait.


    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
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
     
    $message_txt = "Confirmation de commande.";
    $message_html = "
    <a href='http://www.monsite.com'><img align='center' src='image.jpg' alt='presentation' /></a><br/>
     
    <p> Ch&egrave;r(e) client"
    ,<br />
    Votre commande passer sur Monsite.com a bien &eacute;t&eacute; prise en compte.<br />
     
    <table style='width: 500px'>
        <tr>
            <td colspan='4'>Votre panier</td>
        </tr>
        <tr>
    <td><span style='font-weight:bold;'>Libell&eacute;</span></td>
            <td><span style='font-weight:bold;'>Quantit&eacute;</span></td>
            <td><span style='font-weight:bold;'>Prix Unitaire HT</span></td>
                    <td><span style='font-weight:bold;'>Prix Unitaire TTC</span></td>
    <td><span style='font-weight:bold;'>Prix Total TTC</span></td>
            </tr>
            ";
     
             $nbArticles=count($_SESSION['panier']['libelleProduit']);
    for ($i=0 ;$i < $nbArticles ; $i++)
              {
    $message_html = $message_html."
    <tr><td>
            ".$_SESSION['panier']['libelleProduit'][$i]."</td>
            <td>".$_SESSION['panier']['qteProduit'][$i]."</td>
            <td>".$_SESSION['panier']['prixProduit'][$i]."</td>
            <td>".$_SESSION['panier']['prixProduitTTC'][$i]."</td>
            <td>".$_SESSION['panier']['prixProduitTTC'][$i] * $_SESSION['panier']['qteProduit'][$i]."</td>
     
     
     
    <td>".$_SESSION['panier']['prixProduitTTC'][$i]."</td>
    </tr>
     
    ";
     
            }
     
    $message_html= $message_html ." 
     
    <tr><td colspan=\'4\'> </td>
              <td colspan=\'2\'>
        <span style='font-weight:bold;'>Frais de Livraison: ".$livraison."  </span>
            </td></tr>
    <tr><td colspan=\'4\'> </td>
              <td colspan=\'2\'>
        <span style='font-weight:bold;'>Total TTC: ".$totalTTC."  </span>
            </td></tr>
     
            </table>
    <br/>
            <table> 
    <h2> RECAPITULATIF DE VOS INFORMATIONS </h2>
     
           <p> civilite : ".$_POST['civilite']." </p>
        <p> Nom Responsable : ".$_POST['nomResp']." </p>
        <p> Nom societe : ".$_POST['nomSoc']." </p>
        <p> adresse Livraison : ".$_POST['adresse']." </p>
        <p> Ville : ".$_POST['ville']." </p>
        <p> Code Postal : ".$_POST['codePostal']." </p>
        <p> Telephone : ".$_POST['telephone']." </p>
     
        <p> Mail : ".$_POST['mail']."
            <p> Commentaire : ".$_POST['description']." </p>
            </table>
        <br/><br/><p><a href='http://www.monsite.com'> <img src='http://www.monsite.com/img'></a></p>
     
    ";
    //==========
     
     
    //=====Création de la boundary.
    $boundary = "-----=".md5(rand());
    $boundary_alt = "-----=".md5(rand());
    //==========
     
    //=====Définition du sujet.
    $sujet = "Monsite.com : Commande enregister";
    //=========
     
    //=====Création du header de l'e-mail.
    $header = "From: \"Monsite.com\"<contact@monsite.com>".$passage_ligne;
    $header.= "Reply-to: \"no-reply@monsite.com\" <contact@monsite.com>".$passage_ligne;
    $header.= "MIME-Version: 1.0".$passage_ligne;
    $header.= "Content-Type: multipart/mixed;".$passage_ligne." boundary=\"$boundary\"".$passage_ligne;
    $header .= "Message-ID: <contact@monsite.com>".$passage_ligne;
    $header .= "X-Mailer: PHP v".phpversion().$passage_ligne;   
     
     
    //==========
     
     
    //=====Création du message.
    $message = $passage_ligne."--".$boundary.$passage_ligne;
    $message.= "Content-Type: multipart/alternative;".$passage_ligne." boundary=\"$boundary_alt\"".$passage_ligne;
    $message.= $passage_ligne."--".$boundary_alt.$passage_ligne;
    //=====Ajout du message au format texte.
    $message.= "Content-Type: text/plain; charset=\"ISO-8859-1\"".$passage_ligne;
    $message.= "Content-Transfer-Encoding: 8bit".$passage_ligne;
    $message.= $passage_ligne.$message_txt.$passage_ligne;
    //==========
     
    $message.= $passage_ligne."--".$boundary_alt.$passage_ligne;
     
    //=====Ajout du message au format HTML.
    $message.= "Content-Type: text/html; charset=\"ISO-8859-1\"".$passage_ligne;
    $message.= "Content-Transfer-Encoding: 8bit".$passage_ligne;
    $message.= $passage_ligne.$message_html.$passage_ligne;
    //==========
     
    //=====On ferme la boundary alternative.
    $message.= $passage_ligne."--".$boundary_alt."--".$passage_ligne;
    //========== 
     
    $message.= $passage_ligne."--".$boundary.$passage_ligne;
     
     
    //========== 
    //=====Envoi de l'e-mail.
    mail($mail,$sujet,$message,$header);



    Merci

  5. #5
    Membre du Club
    Homme Profil pro
    IT Operator
    Inscrit en
    Mars 2013
    Messages
    43
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Vosges (Lorraine)

    Informations professionnelles :
    Activité : IT Operator
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2013
    Messages : 43
    Points : 44
    Points
    44
    Par défaut
    bah ton $message_html il va pas du tout, ton tableau doit être dedans or là il est à l'extérieur. ça devrait donner ça si j'ai bien compris :

    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
    $message_html = "
    <a href='http://www.monsite.com'><img align='center' src='image.jpg' alt='presentation' /></a><br/>
     
    <p> Ch&egrave;r(e) client
    ,<br />
    Votre commande passer sur Monsite.com a bien &eacute;t&eacute; prise en compte.<br />
     
    <table style='width: 500px'>
        <tr>
            <td colspan='4'>Votre panier</td>
        </tr>
        <tr>
    <td><span style='font-weight:bold;'>Libell&eacute;</span></td>
            <td><span style='font-weight:bold;'>Quantit&eacute;</span></td>
            <td><span style='font-weight:bold;'>Prix Unitaire HT</span></td>
                    <td><span style='font-weight:bold;'>Prix Unitaire TTC</span></td>
    <td><span style='font-weight:bold;'>Prix Total TTC</span></td>
            </tr>
            ";
     
        $nbArticles=count($_SESSION['panier']['libelleProduit']);
    	for ($i=0 ;$i < $nbArticles ; $i++){
    		$message_html .= "
    		<tr><td>
    			".$_SESSION['panier']['libelleProduit'][$i]."</td>
    			<td>".$_SESSION['panier']['qteProduit'][$i]."</td>
    			<td>".$_SESSION['panier']['prixProduit'][$i]."</td>
    			<td>".$_SESSION['panier']['prixProduitTTC'][$i]."</td>
    			<td>".$_SESSION['panier']['prixProduitTTC'][$i] * $_SESSION['panier']['qteProduit'][$i]."</td>
     
    			<td>".$_SESSION['panier']['prixProduitTTC'][$i]."</td>
    		</tr>";
    		}
     
    $message_html.=" 
     
    <tr><td colspan=\'4\'> </td>
              <td colspan=\'2\'>
        <span style='font-weight:bold;'>Frais de Livraison: ".$livraison."  </span>
            </td></tr>
    <tr><td colspan=\'4\'> </td>
              <td colspan=\'2\'>
        <span style='font-weight:bold;'>Total TTC: ".$totalTTC."  </span>
            </td></tr>
     
            </table>
    <br/>
            <table> 
    <h2> RECAPITULATIF DE VOS INFORMATIONS </h2>
     
           <p> civilite : ".$_POST['civilite']." </p>
        <p> Nom Responsable : ".$_POST['nomResp']." </p>
        <p> Nom societe : ".$_POST['nomSoc']." </p>
        <p> adresse Livraison : ".$_POST['adresse']." </p>
        <p> Ville : ".$_POST['ville']." </p>
        <p> Code Postal : ".$_POST['codePostal']." </p>
        <p> Telephone : ".$_POST['telephone']." </p>
     
        <p> Mail : ".$_POST['mail']."
            <p> Commentaire : ".$_POST['description']." </p>
            </table>
        <br/><br/><p><a href='http://www.monsite.com'> <img src='http://www.monsite.com/img'></a></p>
     
    ";

  6. #6
    Membre à l'essai
    Inscrit en
    Mars 2011
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 25
    Points : 18
    Points
    18
    Par défaut
    Si j'ai bien compris tu à modifier $message_html = $message_html." ...." en $message_html.=" ...." ou il y a autre chose ?

  7. #7
    Membre à l'essai
    Inscrit en
    Mars 2011
    Messages
    25
    Détails du profil
    Informations forums :
    Inscription : Mars 2011
    Messages : 25
    Points : 18
    Points
    18
    Par défaut
    Bonjour ,

    Voici la réponse de mon hebergeur

    un problème au niveau du formatage de l'entête "Reply-To". Nous avons regardé à cela. Certains espaces pourraient être la cause de votre problème, il s'agit de la règle "FSL_MISSP_REPLYTO
    Voyez vous de quoi il veulent parler parce que moi pas du tout !

    Merci

  8. #8
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    251
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 251
    Points : 383
    Points
    383
    Par défaut
    Quelle idée d'utiliser mail() directement. S'il y a un topic tous les 2 jours au sujet d'envoi de mail() c'est pas pour rien.

    Commence déjà par utiliser une bibliothèque toute faite, par exemple https://github.com/PHPMailer/PHPMailer . Ca t'évitera de gérer les retours à la ligne et les entêtes à la main - tout en simplifiant ton code.

    Ensuite tu peux passer par un outil de test de spam ( http://www.mail-tester.com/ ) qui te dira où ca coince.

    Pour ton problème de reply, c'est probablement parce que tu utilises Reply-to au lieu de Reply-To .

  9. #9
    Membre du Club
    Homme Profil pro
    IT Operator
    Inscrit en
    Mars 2013
    Messages
    43
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Vosges (Lorraine)

    Informations professionnelles :
    Activité : IT Operator
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2013
    Messages : 43
    Points : 44
    Points
    44
    Par défaut
    scvo.One a raison, j'utilise phpmailer et c'est beaucoup plus simple avec ça.

    Si tu veux retester avec la fonction mail() (même si on te conseille de faire avec PHPMailer) essaye ce code modifié :

    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
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
     <?php
    $message_txt = "Confirmation de commande.";
    $message_html = "
    <a href='http://www.monsite.com'><img align='center' src='image.jpg' alt='presentation' /></a><br/>
     
    <p> Ch&egrave;r(e) client
    ,<br />
    Votre commande passer sur Monsite.com a bien &eacute;t&eacute; prise en compte.<br />
     
    <table style='width: 500px'>
        <tr>
            <td colspan='4'>Votre panier</td>
        </tr>
        <tr>
    <td><span style='font-weight:bold;'>Libell&eacute;</span></td>
            <td><span style='font-weight:bold;'>Quantit&eacute;</span></td>
            <td><span style='font-weight:bold;'>Prix Unitaire HT</span></td>
                    <td><span style='font-weight:bold;'>Prix Unitaire TTC</span></td>
    <td><span style='font-weight:bold;'>Prix Total TTC</span></td>
            </tr>
            ";
     
             $nbArticles=count($_SESSION['panier']['libelleProduit']);
    for ($i=0 ;$i < $nbArticles ; $i++)
              {
    $message_html .= "
    <tr><td>
            ".$_SESSION['panier']['libelleProduit'][$i]."</td>
            <td>".$_SESSION['panier']['qteProduit'][$i]."</td>
            <td>".$_SESSION['panier']['prixProduit'][$i]."</td>
            <td>".$_SESSION['panier']['prixProduitTTC'][$i]."</td>
            <td>".$_SESSION['panier']['prixProduitTTC'][$i] * $_SESSION['panier']['qteProduit'][$i]."</td>
     
     
     
    <td>".$_SESSION['panier']['prixProduitTTC'][$i]."</td>
    </tr>
     
    ";
     
            }
     
    $message_html.=" 
     
    <tr><td colspan=\'4\'> </td>
              <td colspan=\'2\'>
        <span style='font-weight:bold;'>Frais de Livraison: ".$livraison."  </span>
            </td></tr>
    <tr><td colspan=\'4\'> </td>
              <td colspan=\'2\'>
        <span style='font-weight:bold;'>Total TTC: ".$totalTTC."  </span>
            </td></tr>
     
            </table>
    <br/>
            <table> 
    <h2> RECAPITULATIF DE VOS INFORMATIONS </h2>
     
           <p> civilite : ".$_POST['civilite']." </p>
        <p> Nom Responsable : ".$_POST['nomResp']." </p>
        <p> Nom societe : ".$_POST['nomSoc']." </p>
        <p> adresse Livraison : ".$_POST['adresse']." </p>
        <p> Ville : ".$_POST['ville']." </p>
        <p> Code Postal : ".$_POST['codePostal']." </p>
        <p> Telephone : ".$_POST['telephone']." </p>
     
        <p> Mail : ".$_POST['mail']."
            <p> Commentaire : ".$_POST['description']." </p>
            </table>
        <br/><br/><p><a href='http://www.monsite.com'> <img src='http://www.monsite.com/img'></a></p>
     
    ";
    //==========
     
     
    //=====Création de la boundary.
    $boundary = "-----=".md5(rand());
    $boundary_alt = "-----=".md5(rand());
    //==========
     
    //=====Définition du sujet.
    $sujet = "Monsite.com : Commande enregister";
    //=========
     
    //=====Création du header de l'e-mail.
    $header = "From: Monsite.com".$passage_ligne;
    $header.= "Reply-to: no-reply@monsite.com".$passage_ligne;
    $header.= "MIME-Version: 1.0".$passage_ligne;
    $header.= "Content-Type: multipart/mixed;".$passage_ligne." boundary=".$boundary."".$passage_ligne;
    $header .= "Message-ID: <contact@monsite.com>".$passage_ligne;
    $header .= "X-Mailer: PHP v".phpversion().$passage_ligne;   
     
     
    //==========
     
     
    //=====Création du message.
    $message = $passage_ligne."--".$boundary.$passage_ligne;
    $message.= "Content-Type: multipart/alternative;".$passage_ligne." boundary=\"$boundary_alt\"".$passage_ligne;
    $message.= $passage_ligne."--".$boundary_alt.$passage_ligne;
    //=====Ajout du message au format texte.
    $message.= "Content-Type: text/plain; charset=\"ISO-8859-1\"".$passage_ligne;
    $message.= "Content-Transfer-Encoding: 8bit".$passage_ligne;
    $message.= $passage_ligne.$message_txt.$passage_ligne;
    //==========
     
    $message.= $passage_ligne."--".$boundary_alt.$passage_ligne;
     
    //=====Ajout du message au format HTML.
    $message.= "Content-Type: text/html; charset=\"ISO-8859-1\"".$passage_ligne;
    $message.= "Content-Transfer-Encoding: 8bit".$passage_ligne;
    $message.= $passage_ligne.$message_html.$passage_ligne;
    //==========
     
    //=====On ferme la boundary alternative.
    $message.= $passage_ligne."--".$boundary_alt."--".$passage_ligne;
    //========== 
     
    $message.= $passage_ligne."--".$boundary.$passage_ligne;
     
     
    //========== 
    //=====Envoi de l'e-mail.
    mail($mail,$sujet,$message,$header);

  10. #10
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    251
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 251
    Points : 383
    Points
    383
    Par défaut
    Je t'arrête tout de suite, rien qu'à la 2eme ligne on voit déjà que ca va foirer.

    Extrait de la documentation de spamassasin :

    SpamAssassin Rule: MPART_ALT_DIFF

    Standard description: HTML and text parts are different

    Explanation

    The mail contains the content in both HTML and plain text format, but their content is (very probably) different. This suggests that the sender is not using a normal mail client, and is attempting to evade filtering by using a message which looks different to humans and mail filters.
    $message_txt doit avoir le contenu $message_html, mais sans balises html. Reply-to n'est pas corrigé et devrait au minimum renvoyer sur une boîte mail qui fonctionne; Message-ID est censé être unique...

  11. #11
    Membre du Club
    Homme Profil pro
    IT Operator
    Inscrit en
    Mars 2013
    Messages
    43
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Vosges (Lorraine)

    Informations professionnelles :
    Activité : IT Operator
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2013
    Messages : 43
    Points : 44
    Points
    44
    Par défaut
    $message_html peut très bien avoir des balises html, je l'ai déjà fais et ça fonctionne

  12. #12
    Membre averti
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    251
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 251
    Points : 383
    Points
    383
    Par défaut
    Je n'ai pas dit le contraire.

  13. #13
    Membre du Club
    Homme Profil pro
    IT Operator
    Inscrit en
    Mars 2013
    Messages
    43
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Vosges (Lorraine)

    Informations professionnelles :
    Activité : IT Operator
    Secteur : Communication - Médias

    Informations forums :
    Inscription : Mars 2013
    Messages : 43
    Points : 44
    Points
    44
    Par défaut
    Ah oui autant pour moi j'ai cru que tu parlais de $message_txt

    J'ai pas fais sa variable en txt c'est pas à moi de le faire, j'ai juste modifié son code pour que peut-être ça fonctionne. Mais bon on a pas de réponse toute façon donc xD

Discussions similaires

  1. [Mail] Fonction mail() bloquée par neuf
    Par Général03 dans le forum Langage
    Réponses: 11
    Dernier message: 21/02/2009, 20h41
  2. [Mail] La fonction mail
    Par amine_smi dans le forum Langage
    Réponses: 6
    Dernier message: 21/05/2006, 23h12
  3. [Mail] la fonction Mail
    Par imen120 dans le forum Langage
    Réponses: 12
    Dernier message: 17/01/2006, 15h23
  4. [Mail] la fonction mail
    Par wodel dans le forum Langage
    Réponses: 1
    Dernier message: 08/01/2006, 13h05
  5. [Mail] Probleme fonction mail()
    Par tissot dans le forum Langage
    Réponses: 1
    Dernier message: 14/11/2005, 12h55

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo