The <br> tag is used in HTML to create new lines. In plain text files, this is done with the \n or \r\n special characters (depending on operating system used).
Pro tip: you can use the nl2br PHP function to convert the \n characters in a string to <br> tags.
Fatal error : require(): Failed opening required â/home/pianocou/public_html/includesâŚ/PHPMailer/PHPMailerAutoload.phpâ (include_path=â.:/opt/cpanel/ea-php73/root/usr/share/pearâ) in /home/pianocou/public_html/includes/signup2.php on line 460
I now have the following error: How do you use this instead of autoload?
Deprecated : __autoload() is deprecated, use spl_autoload_register() instead in /home/pianocou/public_html/PHPMailer/PHPMailerAutoload.php on line 45
Mailer Error: SMTP connect() failed. Troubleshooting ¡ PHPMailer/PHPMailer Wiki ¡ GitHub
Also, when using the following code to display errors, must it be on every single page?
ini_set(âerror_reportingâ, E_ALL);
ini_set(âdisplay_errorsâ, âOnâ); //On or Off
Which version is that and where do I get the latest version? Also, must I put the error reporting on every page that I want to debug? So I donât have to use the spl_autoload? I thought that the file you gave me is the latest version?
So must I include the following on every single page? I read somewhere that I have to if I were to use the following code:
ini_set(âerror_reportingâ, E_ALL);
ini_set(âdisplay_errorsâ, âOnâ); //On or Off
You must upload the files inside the src folder of it on your PHPMailer folder, but delete the files of the older version!
Yes, you must put error reporting on every page.
include_once includes the files just once, require requires them. The ../ means to go back a directory. You even need to use these classes (include these lines just at the start of the mailer file):
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
Are you on a different cPanel than ours (seen from the url https://cpanel.space:2083)? You can even require PHPMailer without __DIR__ variable, but just with this (replace your lines with these):
Then define the $mail function as new PHPMailer(true), and try to connect to SMTP, send an email and throw a success if itâs successful. If not throw an exception, defined by the PHPMailer Exception.php file, that throws a Mailer Error.
Thanks but my cpanel does not recognise the function use? I am using cpanel.space at the moment and just trying out their cpanel there⌠but so my following lines should work?
Then the variable use isnât supported on your cPanel, but InfinityFree, Byethost and their affiliates do. Even on my AWS server the âuseâ variable is working fine without âSyntax error: unexpected âT_USEâ, expected {something else} in {filelocation} on line xâ.
I donât know. My mailer script was tested here before PHP 7.0 was replaced with 7.3 and with my AWS Ubuntu server with Apache 2.4.29, PHP 7.2 and the latest version of MariaDB and phpMyAdmin. Maybe it would work for you if the PHP version of cpanel.space has enabled use variables.