我目前的法典就是这样。
$swift = email::connect();
$swift->setSubject( hello )
->setFrom(array( alex@example.com.au => Alex ))
->setTo(array( alex@example.com.au => Alex ))
->setBody( hello )
->attach(Swift_Attachment::fromPath(DOCROOT . assets/attachments/instructions.pdf ));
$swift->send();
然而,我有了一个错误。
Fatal error: Call to undefined method Swift_Mailer::setSubject() in /home/user/public_html/application/classes/controller/properties.php on line 45
I ve see that email:link()
do soly what the example Code in the docs do. 这就是说:
- include the correct file
- return an instance of the library
我做了什么错误?
增 编