Having error from this
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
}
$mail->Port = $config->port;
$mail->CharSet = 'UTF-8';
//Recipients
$mail->setFrom($gnl->email_from, $gnl->sitetitle);
$mail->addAddress($receiver_email, $receiver_name);
$mail->addReplyTo($gnl->email_from, $gnl->sitename);
// Content
$mail->isHTML(true);
$mail->Subject = $subject;
This is were my error is from
$mail->setFrom($gnl->email_from, $gnl->sitetitle);
2
Answers
Verify that the property name ’email_from’ exists in the
$gnl
object and that it’s spelled correctly.This error means that the $gnl variable is actually a string rather than an object which you assume it is.
Do a bit of ddd() debugging earlier on to see where the $gnl variable comes from.