Bonjour à tous,
J'ai un petit soucis avec l'envoie de mailing:
dès que j'ajoute une image ou un background, le mail n'est pas envoyé :/
mail:
gabarit html:
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 $site = "www.monsite.fr"; $from = "contact@monsite.fr"; $nom = "monsite.fr" $from = $nom." <".$from.">"; $limite = "_----------=_parties_".md5(uniqid (rand())); $header = "Reply-to: ".$from."\n"; $header .= "From: ".$from."\n"; $header .= "X-Sender: <".$site.">\n"; $header .= "X-Mailer: PHP\n"; $header .= "X-auth-smtp-user: ".$from." \n"; $header .= "X-abuse-contact: ".$from." \n"; $header .= "Date: ".date("D, j M Y G:i:s O")."\n"; $header .= "MIME-Version: 1.0\n"; $header .= "Content-Type: multipart/alternative; boundary=\"".$limite."\""; $message = "--".$limite."\n"; $message .= "Content-Type: text/plain; charset=iso-8859-1\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; $message .= "Votre navigateur n'accèpte pas le HTML."; $message .= "\n\n--".$limite."\n"; $message .= "Content-Type: text/html; charset=iso-8859-1\n"; $message .= "Content-Transfer-Encoding: 8bit\n\n"; $message .= $msg; $message .= "\n\n--".$limite."--"; if(!mail($userMail, $subject, $message, $header)){ echo "Ok"; } else { echo "Ko"; }
Ceci marche correctement,
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 $string = " <html> <body style='margin:0;padding:0;'> <table style='width:100%;' cellspacing='0' cellpadding='0'> <tr> <td> <div style='width:760px; margin-left:auto; margin-right:auto;'> <center> logo </center> </div> </td> </tr> <tr> <td style='padding-top:15px;padding-bottom:30px;'> <table cellspacing='0' cellpadding='0' style='margin-left:auto; margin-right:auto;'> <tr> <td width='760px;' valign='top'> <table style='width:100%;' cellspacing='0' cellpadding='0'> <tr> <td style='height:42px; font-size:11px; text-align:center; font-weight:bold; color:#fff; line-height:42px;'> Message: test </td> </tr> <tr> <td style='padding:20px; font-size:11px; text-align:justify;'> </td> </tr> <tr> <td style='height:15px; line-height:15px; margin-bottom:10px;'> </td> </tr> </table> </td> </tr> </table> </td> </tr> <tr> <td style='border-top: 2px solid #000000; padding: 10px 0; color:#AAAAAA; font-size: 11px;'> Ce courriel et les documents qui lui sont joints peuvent contenir des informations confidentielles ou ayant un caractère privé. S'ils ne vous sont pas destinés, nous vous signalons qu'il est strictement interdit de les divulguer, de les reproduire ou d'en utiliser de quelque manière que ce soit le contenu. Si ce message vous a été transmis par erreur, merci d'en informer l'expéditeur et de supprimer immédiatement de votre système informatique ce courriel ainsi que tous les documents qui y sont attachés. </td> </tr> </table> </body> </html>";
Pourtant lorsque je remplace "logo" par "<img src='http://monsite.fr/chemin/image.png'" sur un td, rien n'est envoyé;
Pourtant mail() me renvoie toujours OK, et je n'ai rien dans le spam ni quoi que ce soit.
Je suis un peu perdu ...
Merci d'avance






Répondre avec citation

Partager