Welcome Guest, Not a member yet? Register   Sign In
Class "PHPMailer\PHPMailer\PHPMailer" not found
#5

(This post was last modified: 08-31-2022, 04:25 PM by kenjis.)

It seems your code should work.

Code:
--- a/app/Controllers/Home.php
+++ b/app/Controllers/Home.php
@@ -2,10 +2,22 @@

namespace App\Controllers;

+use PHPMailer\PHPMailer\PHPMailer;
+use PHPMailer\PHPMailer\SMTP;
+
class Home extends BaseController
{
    public function index()
    {
-        return view('welcome_message');
+        $mail = new PHPMailer(true);
+
+        $mail->SMTPDebug = SMTP::DEBUG_SERVER;
+        $mail->isSMTP();
+        $mail->Host      = 'mai';
+        $mail->SMTPAuth  = true;
+        $mail->Username  = 'noreply';
+        $mail->Password  = 'pass';
+        $mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS;
+        $mail->Port      = 587;
    }
}

There is no error:

Code:
$ php public/index.php
$
Reply


Messages In This Thread
RE: Class "PHPMailer\PHPMailer\PHPMailer" not found - by kenjis - 08-31-2022, 04:20 PM



Theme © iAndrew 2016 - Forum software by © MyBB