En essayant d'envoyer un mail en utilisant la fonction mail de php, j'ai le problème suivant :
Configuration de l'entête dans le fichier PHP
$_charset = 'ISO-8859-1';
$_email = 'nom.prenom@domaine.fr';
$_subject = 'test';
$_body = 'test';
$_headers = 'From: '.utf8_decode('nom.prenom@domaine.frr').' <nom.prenom@domaine.fr>'.chr(10);
$_headers .= 'Mime-Version: 1.0'.chr(10);
$_headers .= 'Content-Type: text/html; charset='.$_charset.chr(10);
$_headers .= 'Content-Transfer-Encoding: quoted-printable'.chr(10);
$_headers .= 'Return-Path: nom.prenom@domaine.frr'.chr(10);
$_returnPath = "-fnom.prenom@domaine.fr";
Envoi du mail :
mail($_email, $_subject, $_body, $_headers, $_returnPath);
Mail en reception :
L'entête du mail est mal interprété pour le from
From : nom.prenom@ <domaine.fr nom.prenom@domaine.fr>
C'est le caractère @ qui pose souci dans la première partie du from mais je ne peux pas le supprimer. Le problème a juste lieu lorsque que le destinataire est en exchange 2010.
PAs de soucis sur les gmail, laposte, sfr, free.....
Y-a t'il une configuration sur exchange ??? ou autre ?
Partager