Bonjour,
j'essaie d'utiliser PHPmailer pour la 1ère fois.

Je teste (formulaire "contact") :
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;
N.B. étant chez OVH (guide email), SMTP est de la forme : 'smtp.nom-de-mon-site.com'

Mais j'ai une erreur :
Mailer error: The following From address failed: [client_Email] : Called Mail() without being connected
Si je commente les 3 lignes concernant le SMTP (IsSMTP, Host, SMTPAuth), le mail est bien envoyé.

Question(s) :
  • Est-il obligatoire de déclarer le SMTP ?
  • Si oui, pourquoi et surtout comment ?


Merci.