Bonjour à tous,
Je suis venu il y'a quelques jours concernant la connexion smtp avec phpmailer, ce problème étant résolu, j'arrive donc à envoyer les mails depuis le site avec phpmailer mais il sont considéré comme des spam dans gmail par exemple.
Tout d'abord voici le code utiliser pour envoyer le mail
Et voilà le message originale reçus :
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 <?php require '../phpmailer/class.phpmailer.php'; $mail = new PHPMailer(true); $texte = "mon message"; $html = "mon <b>message</b>"; $email = "destinataire@gmail.com"; $nom = "Son nom"; /** Configuration **/ $mail->Mailer = 'smtp'; // Nom du mailer $mail->IsSMTP(); // Déclare l'utilisation SMTP $mail->Host = 'mailout.one.com'; // Adresse du serveur smtp $mail->SMTPAuth = false; // Désactive SMTP authentication (one.com l'exige) $mail->Port = 25; // Port de connexion (25 pour one.com) //$mail->SMTPDebug = 2; // Affichage des erreures de phpmailer $mail->Timeout = 30; // Définit le timeout $mail->XMailer = 'infos'; $mail->Sender = 'inscription@domaine.be'; $mail->From = 'inscription@domaine.be'; // Expéditeur (moi) $mail->FromName = 'infos'; $mail->AddAddress($email, $nom); // E-mail et nom du destinataire (lui) // Plusieur AddAddress possible $mail->AddReplyTo('inscription@domaine.be', 'infos); // Définition de l'adresse de réponse (moi) $mail->IsHTML(true); // Type de mail (true = HTML) (false = TEXTE) $mail->Subject = 'Confirmation de votre inscription'; // Sujet du message $mail->Body= $html; $mail->AltBody= $texte; if(!$mail->Send()){ echo $mail->ErrorInfo; } else{ echo 'E-mail envoyer'; } ?>
et pour la comparaison voilà l'originale envoyé par webmailDelivered-To: destinataire@gmail.com
Received: by 10.68.85.99 with SMTP id g3csp47939pbz;
Thu, 31 Jan 2013 01:17:19 -0800 (PST)
X-Received: by 10.66.84.3 with SMTP id u3mr18703796pay.51.1359623839603;
Thu, 31 Jan 2013 01:17:19 -0800 (PST)
Return-Path: <inscription@domaine.be>
Received: from mail-out2.b-one.net (mail-out2.one.com. [91.198.169.19])
by mx.google.com with ESMTP id xg10si4174836pbc.27.2013.01.31.01.17.19;
Thu, 31 Jan 2013 01:17:19 -0800 (PST)
Received-SPF: neutral (google.com: 91.198.169.19 is neither permitted nor denied by best guess record for domain of inscription@domaine.be) client-ip=91.198.169.19;
Authentication-Results: mx.google.com;
spf=neutral (google.com: 91.198.169.19 is neither permitted nor denied by best guess record for domain of inscription@domaine.be) smtp.mail=inscription@domaine.be
Received: from www.domaine.be (web01-02.local [10.246.64.12])
by mail-out2.b-one.net (Postfix) with ESMTP id E576E10B9E
for <destinataire@gmail.com>; Thu, 31 Jan 2013 10:14:14 +0100 (CET)
Date: Thu, 31 Jan 2013 09:14:14 +0000
From: =?iso-8859-1?Q?Mon nom?= <inscription@domaine.be>
Reply-To: =?iso-8859-1?Q?Mon nom?= <inscription@domaine.be>
Subject: Confirmation de votre inscription
Message-ID: <68978950dcfda765242b79815c8ee348@www.domaine.be>
X-Priority: 3
X-Mailer: www.domaine.be
To: destinataire@gmail.com
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="b1_68978950dcfda765242b79815c8ee348"
--b1_68978950dcfda765242b79815c8ee348
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
mon message
--b1_68978950dcfda765242b79815c8ee348
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
mon <b>message</b>
--b1_68978950dcfda765242b79815c8ee348--
Voyez-vous un problème avec les headers peut-être ?Delivered-To: destinataire@gmail.com
Received: by 10.68.85.99 with SMTP id g3csp48313pbz;
Thu, 31 Jan 2013 01:38:42 -0800 (PST)
X-Received: by 10.68.213.169 with SMTP id nt9mr8436756pbc.65.1359625122698;
Thu, 31 Jan 2013 01:38:42 -0800 (PST)
Return-Path: <inscription@domaine.be>
Received: from webmail-out2.b-one.net (webmail-out2.one.com. [91.198.169.17])
by mx.google.com with ESMTP id tf4si4171250pbc.356.2013.01.31.01.38.41;
Thu, 31 Jan 2013 01:38:42 -0800 (PST)
Received-SPF: neutral (google.com: 91.198.169.17 is neither permitted nor denied by best guess record for domain of inscription@domaine.be) client-ip=91.198.169.17;
Authentication-Results: mx.google.com;
spf=neutral (google.com: 91.198.169.17 is neither permitted nor denied by best guess record for domain of inscription@domaine.be) smtp.mail=inscription@domaine.be
Received: from bmail03.one.com (bmail03.one.com [91.198.169.244])
by webmail-out2.b-one.net (Postfix) with ESMTP id 56C7120403E21
for <destinataire@gmail.com>; Thu, 31 Jan 2013 10:38:41 +0100 (CET)
Received: by bmail03.one.com (Postfix, from userid 33)
id 541A550C68E5F; Thu, 31 Jan 2013 10:38:41 +0100 (CET)
MIME-Version: 1.0
From: "Mon nom" <inscription@domaine.be>
To: destinataire@gmail.com
Subject: Confirmation de l'inscription
Date: Thu, 31 Jan 2013 10:38:41 +0100
X-Mailer: One.com webmail
X-Sender: inscription@domaine.be
X-Originating-Ip: 91.198.169.244
Received: from 91.198.169.244 by webmail.one.com <http://webmail.one.com/>
with HTTP; Thu, 31 Jan 2013 10:38:41 +0100
Content-Type: multipart/alternative; boundary="----------=_1359625121-9606-22"
Message-Id: <20130131093841.541A550C68E5F@bmail03.one.com>
This is a multi-part message in MIME format...
------------=_1359625121-9606-22
Content-Type: text/plain; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
mon message
------------=_1359625121-9606-22
Content-Type: text/html; charset="iso-8859-1"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
<html><HEAD>
<STYLE type=3Dtext/css>p{margin: 0;}</STYLE>
<META name=3DGENERATOR content=3D"MSHTML 9.00.8112.16457"></HEAD>
<BODY style=3D"FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZ=
E: 10pt">mon <STRONG>message</STRONG></BODY></html>=
------------=_1359625121-9606-22--
Quand je l'envoi depuis le web mail il passe mais du site il est dans les spam.
D'avance merci de votre particpation.
Bien à vous
Spliffer







Répondre avec citation
Partager