How to show a php variable inside html tags?

I’m using phpmailer to send otp via email, in the Body part of the email, I’m trying to show a php variable $otp inside $otp tag but it just Shows $otp instead of the value //value of $otp $ot=rand(100000,999999); $otp=strval($ot); of the variable. I tried with the below code. $mail->Body = ‘<h2 style="background: #00466a;margin: 0… Read More How to show a php variable inside html tags?

SMTP ERROR: Failed to connect to server: Permission denied (13) SMTP connect() failed

I don’t undestand why there is the error, maybe i am doing something wrong with the config, maybe with the host. on localhost this config is working, on my online server, with certificate ssl i have this problem <?php use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\SMTP; use PHPMailer\PHPMailer\Exception; require ‘vendor/autoload.php’; $mail = new PHPMailer(); $mail->SMTPDebug = 1; $mail->isSMTP();… Read More SMTP ERROR: Failed to connect to server: Permission denied (13) SMTP connect() failed

Attempt to read property when calling a class

i am getting this error when i call my phpMailer class Warning: Attempt to read property "email" on array in C:\xampp\htdocs\WiShop\core\controllers\admin.php on line 254 and this is my line 254 $result = $email -> send_email_admin_cancel_order($client_info[0] -> full_name, $client_info -> email, $_GET[‘code’]); and this is class call on line 253 $email = new sendEmail; and i… Read More Attempt to read property when calling a class

Problem with sending all emails to the same person when sending email with PHPMailer

I am trying to send mail to multiple emails with PHPMailer. First, I listed people’s names from the table. Then I used the loop to send emails to those people. but the problem is that everyone’s information goes to all emails. PHPMailer foreach ($id as $mailId) { $connect->connect(‘account where id=:id’, array(‘id’ => $mailId), ”, 0);… Read More Problem with sending all emails to the same person when sending email with PHPMailer