Bonjour
J'envoie des mails sans problèmes avec un site héberger chez NFRANCE.
Mais je n'arrive pas à gérer le 'FROM'
L'objet et le mail de réponse => ok.
Dans outlook la colonne 'DE' il y à 'nomDuCompte@return.nfrance.com'
Impossible de mettre autre chose.
Voici mon code
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
 
$boundary = "-----=".md5(uniqid(rand()));
 
 
$header = "MIME-Version: 1.0\r\n";
 
$header .= "Content-Type: multipart/mixed; boundary=\"$boundary\"\r\n";
 
$headers .="Return-Path:Menu Brochette<contact.ai@free.fr>\n"; 
 
$headers .= "From: Menu Brochette<contact.ai@free.fr>";
 
$header .= "\r\n";
 
//--------------------------------------------------
// Construction du message
//--------------------------------------------------
 
$msg = "Je vous informe que ceci est un message au format MIME 1.0 multipart/mixed.\r\n";
 
$msg .= "--$boundary\r\n";
 
 
$msg .= "Content-Type: text/html; charset=\"iso-8859-1\"\r\n";
 
$msg .= "Content-Transfer-Encoding:8bit\r\n";
 
$msg .= "\r\n";
 
 
$file = "menu.jpg";
$fp = fopen($file, "rb");   // b c'est pour les windowsiens
$attachment = fread($fp, filesize($file));
fclose($fp);
 
 
$attachment = chunk_split(base64_encode($attachment));
 
 
$msg .= "--$boundary\r\n";
 
$msg .= "Content-Type: image/gif; name=\"$file\"\r\n";
 
$msg .= "Content-Transfer-Encoding: base64\r\n";
 
$msg .= "Content-Disposition: inline; filename=\"$file\"\r\n";
 
$msg .= "\r\n";
 
$msg .= $attachment . "\r\n";
 
$msg .= "\r\n\r\n";
 
$msg .= "--$boundary--\r\n";
 
$reponse      = "contact.ai@free.fr";
 
echo "test :Ce script envoie un mail avec fichier attach&eacute; &agrave; $destinataire<br>";
 
mail($destinataire, "Menu du jour BROCHETTE..RIT", $msg,"Reply-to: $reponse\r\nFrom: $expediteur\r\n".$header);
 
etc....
Est il possible de "forcer " le nom de l'expediteur ?

Merci de votre aide
.
.