繁体   English   中英

PHP找不到类'GhostMailer'

[英]PHP can't find class 'GhostMailer'

因此,我试图调用邮件程序类的某些功能。在phpStorm中,当我键入GhostMailer::setSender();

当我单击GhostMailer::上的滚动按钮到GhostMailer::所在的位置时,可以导航到该文件,但是每当我运行该程序时,它都会显示未找到GhostMailer类。

呼叫代码

GhostMailer::setSender(Input::get('emailfrom'));
GhostMailer::addRecipient(Input::get('emailto'));
GhostMailer::setSubject(Input::get('subject'));
GhostMailer::setHTML(true);
GhostMailer::setMessage(Input::get('email'));
GhostMailer::setReturnAddress(Input::get('emailfrom'));
GhostMailer::getHeaders();
GhostMailer::send();

我该如何解决?

在我看来,该类(文件)并未真正加载,因此该类在运行时不存在。

composer.jsonclassmap数组中添加"app/classes" ,然后运行composer dump-autoload ,您应该一切顺利

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM