My "PHPMailer" folder is placed in the Vendor in the Library inside the Thinkphp framework.
The browser error is:
But when the cursor is positioned at the call point of the SendMail function, press ctrl left-click, and the function can be positioned at the function definition point.
黄舟2017-05-16 13:01:30
require_once($_SERVER['DOCUMENT_ROOT']."/PHPMailer/class.phpmailer.php")
Try quoting like this (the path must be written completely)
过去多啦不再A梦2017-05-16 13:01:30
Is it tp3?
The error you reported means that the class was not instantiated.
Vendor('PHPMailer.PHPMailerAutoload');
$mail = new PHPMailer(); //实例化
$mail->sendmail(...);
世界只因有你2017-05-16 13:01:30
Vendor('PHPMailer.PHPMailerAutoload');
$mail = new PHPMailer(); //Instantiation
世界只因有你2017-05-16 13:01:30
The problem is that the sendmailer function is written in the function.php file and cannot be written in the common.php file. This way you can call it.