Bonjour,
je suis encore debutant ,je cherche des cours pour savoir comment utiliser Php pour envoyer des mail ,via mail() ou phpmailer, je voudrais tout aprendre du debut a la fin.
comment configurer httpd et php.ini
j'utilise wampserveur sous windows
le message d'erreur
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 $to = 'truc@server.com'; // Subject $subject = 'Developpez.com - Test Mail'; // Message $msg = 'Developpez.com - Message du mail ...'; // Function mail() mail($to, $subject, $msg);
merciWarning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in D:\wamp\www\mail2.php on line 16
Apres changement dans php.ini ,le resultats :
Avec un autre script :Warning: mail() [function.mail]: SMTP server response: 530 5.7.0 Must issue a STARTTLS command first. x6sm11312466gvf.24 in D:\wamp\www\mail2.php on line 23
Votre message n'a pas pu être envoyé
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 <?php require "phpmailer/class.phpmailer.php"; $mail = new PHPmailer(); $mail->From='votre@adresse'; $mail->AddAddress('upload/'); $mail->AddReplyTo('votre@adresse'); $mail->Subject='Exemple trouvé sur DVP'; $mail->Body='Voici un exemple d\'e-mail au format Texte'; 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'; } echo 'aaa'.$mail.'aaaa'; ?>COMMENT UTILISER PHPMAILER ,?Language string failed to load: instantiate
Catchable fatal error: Object of class PHPMailer could not be converted to string in D:\wamp\www\mail.php on line 23
merci
Partager