(reprise du message précédent)
Fichier Bob.php qui est le script
Retour écran : Mailer Error: Message body empty
Dans cette version Bob.php est pas dans le répertoire /src
Source GitHub, version 6.0.6 https://github.com/PHPMailer/PHPMailer/blob/master/examples/ssl_options.phps
Je ne suis pas doué
Modifié par Tintin75 (23 Dec 2018 - 12:02)
Fichier Bob.php qui est le script
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'src/Exception.php';
require 'src/PHPMailer.php';
require 'src/SMTP.php';
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Set the hostname of the mail server
$mail->Host = 'b';
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Custom connection options
//Note that these settings are INSECURE
$mail->SMTPOptions = array(
'ssl' => [
'verify_peer' => true,
'verify_depth' => 3,
'allow_self_signed' => true,
'peer_name' => 'X',
'cafile' => '/etc/ssl/ca_cert.pem',
],
);
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = 'x';
//Password to use for SMTP authentication
$mail->Password = 'X';
//Set who the message is to be sent from
$mail->setFrom('x', 'B');
//Set who the message is to be sent to
$mail->addAddress('d', 'Fozzie');
//Set the subject line
$mail->Subject = 'PHPMailer SMTP options test';
$mail->MsgHTML = 'Vive les gilets jaunes !';
//Send the message, check for errors
if (!$mail->send()) {
echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
echo 'Message sent!';
}
?>
Retour écran : Mailer Error: Message body empty
Dans cette version Bob.php est pas dans le répertoire /src
Source GitHub, version 6.0.6 https://github.com/PHPMailer/PHPMailer/blob/master/examples/ssl_options.phps
Je ne suis pas doué
Modifié par Tintin75 (23 Dec 2018 - 12:02)