search

Home  >  Q&A  >  body text

There was an error when submitting data through phpmailer in Thinkphp and sending the data to the mailbox.

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.

曾经蜡笔没有小新曾经蜡笔没有小新2797 days ago552

reply all(6)I'll reply

  • 黄舟

    黄舟2017-05-16 13:01:30

    vendor('PHPMailer/class.phpmailer');

    reply
    0
  • 我想大声告诉你

    我想大声告诉你2017-05-16 13:01:30

    vendor('file entry name');

    reply
    0
  • 黄舟

    黄舟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)

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再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(...);
    

    reply
    0
  • 世界只因有你

    世界只因有你2017-05-16 13:01:30

    Vendor('PHPMailer.PHPMailerAutoload');
    $mail = new PHPMailer(); //Instantiation

    reply
    0
  • 世界只因有你

    世界只因有你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.

    reply
    0
  • Cancelreply