j'ai essayé plusieurs pistes pour envoyer un mail en local, mais échec.
1- avec phpmailer :
require "../../../_lib/class.phpmailer.php";
$mail = new PHPmailer();
$monadresse='---';
$mail->IsSMTP();
$mail->IsHTML(true);
$mail->Host='smtp.orange.fr';
$mail->Port='465';
$mail->SMTPSecure = 'ssl';
//$mail->Encoding = "base64";
$mail->Username = "---"; //idem que $monadresse
$mail->Password = "---";
$mail->SMTPAuth='true';
$mail->From=$monadresse;
$mail->AddAddress($adrmail);
$mail->AddReplyTo($monadresse);
$mail->Subject='Exemple trouvé sur DVP';
$mail->Body='Voici un exemple d\'e-mail au format Texte';
$mail->SMTPDebug = 2;
if(!$mail->Send()){ //Teste le return code de la fonction
echo $mail->ErrorInfo; //Affiche le message d'erreur (ATTENTION:voir section 7)
}
else{
echo 'Mail envoyé avec succès';
}
$mail->SmtpClose();
unset($mail);
2- avec le tuto de grafikart : https://www.grafikart.fr/blog/mail-local-wamp$to =$_POST['mail'];
$message=$_POST['msg'];
$subject=$_POST['subj'];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
mail($to, $subject, $message, $headers);
et sendmail.ini :; configuration for fake sendmail
[sendmail]
smtp_server=smtp.orange.fr
; smtp port (normally 25)
smtp_port=465
; SMTPS (SSL) support
; auto = use SSL for port 465, otherwise try to use TLS
; ssl = alway use SSL
; tls = always use TLS
; none = never try to use SSL
smtp_ssl=auto
error_logfile=error.log
auth_username=xxx
auth_password=xxx
pop3_server=
pop3_username=
pop3_password=
force_sender=xxx ;idem auth_username
force_recipient=
hostname=
Comment faudrait-il faire ?