gpt4 book ai didi

Attempt to read property "email_from" on string(尝试读取字符串上的属性“Email_From”)

转载 作者:bug小助手 更新时间:2023-10-24 17:10:55 27 4
gpt4 key购买 nike



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);

更多回答
优秀答案推荐

This error means that the $gnl variable is actually a string rather than an object which you assume it is.

这个错误意味着$GNL变量实际上是一个字符串,而不是您假设的对象。


Do a bit of ddd() debugging earlier on to see where the $gnl variable comes from.

在前面进行一点DDD()调试,看看$GNL变量来自哪里。



Verify that the property name 'email_from' exists in the $gnl object and that it's spelled correctly.

验证属性名称‘EMAIL_FROM’是否存在于$GNL对象中并且拼写是否正确。


if (is_object($gnl)) {
if (property_exists($gnl, 'email_from')) {
$mail->setFrom($gnl->email_from, $gnl->sitetitle);
} else {
echo "Property 'email_from' does not exist in the \$gnl object.";
}
} else {
echo "\$gnl is not an object.";
}

更多回答

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com