Bonjour,
j'essaie d'utiliser PHPmailer pour la 1ère fois.
Je teste (formulaire "contact") :
N.B. étant chez OVH (guide email), SMTP est de la forme : 'smtp.nom-de-mon-site.com'
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 $mail = new PHPMailer(); $mail->IsSMTP(); // telling the class to use SMTP $mail->Host = 'smtp.nom-de-mon-site.com'; // SMTP server $mail->SMTPAuth = false; // true - false : Enable SMTP authentication $mail->From = $client_Email;
Mais j'ai une erreur :
Si je commente les 3 lignes concernant le SMTP (IsSMTP, Host, SMTPAuth), le mail est bien envoyé.Mailer error: The following From address failed: [client_Email] : Called Mail() without being connected
Question(s) :
- Est-il obligatoire de déclarer le SMTP ?
- Si oui, pourquoi et surtout comment ?
Merci.
Partager