hello I have a problem with phpmailer, I recently implemented an ssl certificate on my site, I want to assume that it affects the write and read permissions, but I'm trying to create a folder with write permissions and send the mail but it does not do any of the two things.
<?php
use PHPMailer\PHPMailer\PHPMailer;
require "PHPMailer/PHPMailer.php";
require "PHPMailer/Exception.php";
if ($_SERVER['REQUEST_METHOD'] != 'POST') {
header('Location: diplomadoventas.php');
exit();
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://ipnpb.sandbox.paypal.com/cgi-
bin/webscr');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, "cmd=_notify-validate&" .
http_build_query($_POST));
$response = curl_exec($ch);
curl_close($ch);
dir = 'myDir';
// create new directory with 744 permissions if it does not exist yet
// owner will be the user/group the PHP script is run under
if ( !file_exists($dir) ) {
mkdir ($dir, 0744);
}
file_put_contents ($dir.'/test.txt', $response);
if($response == "VERIFIED" && $_POST['receiver_email'] == "*********"){
$cEmail = $_POST['payer_email'];
$name = $_POST['first_name'];
$price = $_POST['mc_gross'];
$currency = $_POST['mc_currency'];
$item = $_POST['item_number'];
$paymentStatus = $_POST['payment_status'];
if ($item == "************" && $currency == "USD" $$ $paymentStatus ==
"Completed" && $price == 0.097) {
$mail = new PHPMailer();
$mail->setFrom("************", "Sales");
$mail->addAdress($cEmail, $name);
$mail->isHTML(true);
$mail->Subject = "sales";
$mail->Body = "Hola, <br><br>
thanks";
$mail->Port= 465;
$mail->send();
}
}
?>
is not creating the folder with write permission. paypal sends me the veryfied handshake.