Commenting is not an issue for me, one thing I love about myself is that I can understand HTML and PHP pretty well without comments (One cannot say the same for CSS though, I use comments galore in that.)
A few things to check:
The PHP file is in the same directory as the HTML file and is called exactly “Nachhilfelehrer-login.php” (Note that filenames are case sensitive)
“Less Secure Apps” is enabled in your Google Account Settings
You are using an App Password (Not the password you use to sign in to Google), and have 2Fa enabled.
What’s this console_log function? Did you verify that this function can correctly produce output? If it didn’t, that would explain why you don’t see anything.
Could you perhaps try using PHP functions directly (like echo, var_dump(), etc.) to try to generate some output?
Also, like Greenreader said, not using 2FA when using Gmail also tends to break. Gmail is quite protective like that.
That’s very odd because your PHPMailer code is configured to either say sent if it succeeded or not sent if it did not succeed. If you don’t see either of those things, something else than just a PHPMailer error is occurring.
First: thanks for your help! When I use the function, every html code after it is no longer executed. In the console was this error:
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
So did i integrate the files wrong? ive already searched for this error, but i found nothing with php.
Thanks
I got an error! Its this:
Fatal error : Uncaught Error: Class ‘src\PHPMailer’ not found in /home/vol18_2/epizy.com/epiz_29234248/htdocs/mailsenden.php:16 Stack trace: #0 /home/vol18_2/epizy.com/epiz_29234248/htdocs/Passwort-vergessen.php(41): mailsenden() #1 {main} thrown in**/home/vol18_2/epizy.com/epiz_29234248/htdocs/mailsenden.php** on line16
So what to do right now? In line 16 is $mail = new Phpmailer();
Parse error : syntax error, unexpected ‘/’, expecting ‘;’ or ‘,’
this is the error when im using / and: https://github.com/PHPMailer/PHPMailer
here phpmailer is using also .
the folder src is in htdocs/src/PHPMailer
and the file mailsenden.php is in htdocs/mailsenden.php
If I go to Schuelerhelfenschuelern.rf.gd/src/PHPMailer I get a 404 error, however, Schuelerhelfenschuelern.rf.gd/src/PHPMailer.php returns a valid file. Make sure you have the file paths correct!
Hello Greenreader 9 and everyone else, who helped me,
with this:
use src\PHPMailer;
use src\SMTP;
use src\Exception;
nothing worked, even if the path is correct. So i was trying to use my older version from the localhost:
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
I dont know why it is working right now, but it is working. I found in the localhost file no folder with the name PHPMailer, even if it is a hidden folder. So I dont know what was wrong.
Thanks for your help, especially with the Alter PHP Directives.
Origamifreddi
I think you may be mixing up the include/require and use statements.
First of all, if you’re using Composer, the Composer include should normally be the very first thing of your code. Putting the use statements before the require that actually loads in the class definitions will not work.
Additionally, the use statements refer to PHP namespaces, which don’t automatically map to system paths. The namespace of a class is defined in the PHP code itself. So that’s always\PHPMailer\PHPMailer\PHPMailer, regardless of how your project is actually laid out.