Error Cannot declare class #2658
Unanswered
nucleus-genius
asked this question in
Q&A
Replies: 3 comments 5 replies
-
This will be because you've already loaded it from some other location, for example via composer's autoload. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I didn't upload anything else. The code I showed is all the code related to phpmailer |
Beta Was this translation helpful? Give feedback.
5 replies
-
The problem disappeared after I replaced |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Cannot declare class PHPMailer\PHPMailer\PHPMailer, because the name is already in use in ....../PHPMailer/PHPMailer.php on line 32
code:
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
require_once (quasar_form_path.'lib/PHPMailer/PHPMailer.php');
require_once (quasar_form_path.'lib/PHPMailer/SMTP.php');
$mail = new PHPMailer();
try {
$msg = "ok";
$mail->isSMTP();
$mail->CharSet = "UTF-8";
$mail->SMTPAuth = true;
Beta Was this translation helpful? Give feedback.
All reactions